Firefox minimize SSD writes with multiple profiles

Questions about applications and software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
11Rupees
Level 2
Level 2
Posts: 67
Joined: Wed May 11, 2022 6:53 pm

Firefox minimize SSD writes with multiple profiles

Post by 11Rupees »

I understand one opinion that when you run a web browser in Linux (or maybe any operating system) on an SSD, the web browser amount of writing to the drive can become considerable over time. So, one idea is to have Firefox write the data to RAM.

This guy
https://easylinuxtipsproject.blogspot.com/p/ssd.html
says to set them to ~500 MB.

But, lets say that you run multiple browsers/ multiple profiles/ browser profiles in a virtual machine? For example, let’s say you are running 4 browser profiles at once? Use something other than 500 MB?
Last edited by LockBot on Tue Aug 01, 2023 10:00 pm, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Linux Mint 21.2 Cinnamon, 64 bit (unless stated otherwise)
User avatar
coffee412
Level 8
Level 8
Posts: 2268
Joined: Mon Nov 12, 2012 7:38 pm
Location: I dont know
Contact:

Re: Firefox minimize SSD writes with multiple profiles

Post by coffee412 »

I have a 1tb sdd as my main drive. However, I do have my /home directory on two 4 tb mechanical drives in a raid1 config. So I think most of my writing happens in my /home directory.
/dev/sda2 457G 118G 317G 28% /
Disk model: Samsung SSD 860

/dev/md0 3.6T 1.1T 2.6T 29% /home
Disk model: ST4000NE001-2MA1
Ive been running /dev/sda for a pretty long time. No problems.
Ryzen x1800 Asus Prime x370-Pro 32 gigs Ram RX480 graphics
Dell PE T610, Dell PE T710
- List your hardware Profile: inxi -Fxpmrz
MeshCentral * Virtualbox * Debian * InvoiceNinja * NextCloud * Linux since kernel 2.0.36
SomeDudeInAZ
Level 4
Level 4
Posts: 251
Joined: Sun May 05, 2019 6:48 pm
Location: Scottsdale, AZ, USA

Re: Firefox minimize SSD writes with multiple profiles

Post by SomeDudeInAZ »

11Rupees wrote: Wed Feb 01, 2023 6:28 pm I understand one opinion that when you run a web browser in Linux (or maybe any operating system) on an SSD, the web browser amount of writing to the drive can become considerable over time. So, one idea is to have Firefox write the data to RAM.

This guy
https://easylinuxtipsproject.blogspot.com/p/ssd.html
says to set them to ~500 MB.

But, lets say that you run multiple browsers/ multiple profiles/ browser profiles in a virtual machine? For example, let’s say you are running 4 browser profiles at once? Use something other than 500 MB?
As someone who uses MANY profiles (for Firefox and Thunderbird) AND Virtual Machines the only real limit is your ram. If you have the ram, go for it. I've got mine set for a full 1GB. If you run a bunch of VMs then just be sure to account for browser ram usage when you spec out the VM.
11Rupees
Level 2
Level 2
Posts: 67
Joined: Wed May 11, 2022 6:53 pm

Re: Firefox minimize SSD writes with multiple profiles

Post by 11Rupees »

SomeDudeInAZ wrote: Wed Feb 01, 2023 9:23 pm As someone who uses MANY profiles (for Firefox and Thunderbird) AND Virtual Machines the only real limit is your ram. If you have the ram, go for it. I've got mine set for a full 1GB. If you run a bunch of VMs then just be sure to account for browser ram usage when you spec out the VM.
When you have each set to 1 GB, will each "instance" use up to 1 GB? Or some instances will share the 1 GB?
Linux Mint 21.2 Cinnamon, 64 bit (unless stated otherwise)
SomeDudeInAZ
Level 4
Level 4
Posts: 251
Joined: Sun May 05, 2019 6:48 pm
Location: Scottsdale, AZ, USA

Re: Firefox minimize SSD writes with multiple profiles

Post by SomeDudeInAZ »

Each will use up to 1. So I just write off a gig.

EX: 4 active profiles - that's 4GB of ram. Thus my VM needs to have (in my mind) a min of 8GB (4 for OS/Apps and the other 4 for the browsers). Depending on what I want to use that VM for I might go down to 6 (min) or up to 12.

How much ram do you have available? Given that you're talking about VMs and browsers each VM is a full operating system. so 4-8GB each?

Ram is one of those things I tend to max out on my systems, so it's rarely a problem. On my old DELL system the ram maxes out at 8GB, so there I tend to use 512MB for the browser cache.
11Rupees
Level 2
Level 2
Posts: 67
Joined: Wed May 11, 2022 6:53 pm

Re: Firefox minimize SSD writes with multiple profiles

Post by 11Rupees »

SomeDudeInAZ wrote: Thu Feb 02, 2023 12:43 pm Each will use up to 1. So I just write off a gig.

EX: 4 active profiles - that's 4GB of ram. Thus my VM needs to have (in my mind) a min of 8GB (4 for OS/Apps and the other 4 for the browsers). Depending on what I want to use that VM for I might go down to 6 (min) or up to 12.

How much ram do you have available? Given that you're talking about VMs and browsers each VM is a full operating system. so 4-8GB each?

Ram is one of those things I tend to max out on my systems, so it's rarely a problem. On my old DELL system the ram maxes out at 8GB, so there I tend to use 512MB for the browser cache.
Thank you for the insight. Big help.
I'll take a look at how much RAM I am actually using, especially when I think my tasks are at a "peak" in terms of perceived RAM usage.

I guess one thing about using the RAM as browser cache is that it erases when you close the browser profile? Or at least opens up as available for overwrite?
Linux Mint 21.2 Cinnamon, 64 bit (unless stated otherwise)
SomeDudeInAZ
Level 4
Level 4
Posts: 251
Joined: Sun May 05, 2019 6:48 pm
Location: Scottsdale, AZ, USA

Re: Firefox minimize SSD writes with multiple profiles

Post by SomeDudeInAZ »

You're welcome.

And yes it does erase itself. Also remember:

about:support
about:profiles
about:memory
about:cache
about:config
about:preferences
about:logins
about:performance <== this is a fun one

You can also create a user.js file to make managing things easier:

Code: Select all

//
/******************************************************************************
 * user.js                                                                    *
 * Based on Easy Linux Tips Project about config                              *
 * Remove the "Min " from the file name and copy to profile folder            *
 ******************************************************************************/
// Added by JJS

user_pref("layout.css.devPixelsPerPx", "1.2");
user_pref("browser.tabs.closeWindowWithLastTab", false);
user_pref("browser.tabs.insertRelatedAfterCurrent", false);
user_pref("browser.urlbar.maxRichResults", 0);
user_pref("browser.cache.disk.enable", false);
user_pref("browser.cache.memory.enable", true);
user_pref("browser.cache.memory.capacity", 1048576);
user_pref("browser.sessionstore.interval", 15000000);
user_pref("dom.webnotifications.enabled", false);
user_pref("extensions.pocket.enabled", false);

// Added 2022-11-13 by JJS
user_pref("browser.tabs.firefox-view",false);
Just place this in your profile directory
11Rupees
Level 2
Level 2
Posts: 67
Joined: Wed May 11, 2022 6:53 pm

Re: Firefox minimize SSD writes with multiple profiles

Post by 11Rupees »

SomeDudeInAZ wrote: Thu Feb 02, 2023 5:56 pm You can also create a user.js file to make managing things easier:
I am not too sure of the steps that you are proposing in your post. I guess create a Firefox profile and then add all of that text to the profile text file (and remove Min)?
Linux Mint 21.2 Cinnamon, 64 bit (unless stated otherwise)
SomeDudeInAZ
Level 4
Level 4
Posts: 251
Joined: Sun May 05, 2019 6:48 pm
Location: Scottsdale, AZ, USA

Re: Firefox minimize SSD writes with multiple profiles

Post by SomeDudeInAZ »

11Rupees wrote: Thu Feb 02, 2023 6:53 pm I am not too sure of the steps that you are proposing in your post. I guess create a Firefox profile and then add all of that text to the profile text file (and remove Min)?
Sorry 'bout that.

Code: Select all

//
/******************************************************************************
 * user.js                                                                    *
 * Based on Easy Linux Tips Project about config                              *
 ******************************************************************************/
// Added by JJS

user_pref("layout.css.devPixelsPerPx", "1.2");
user_pref("browser.tabs.closeWindowWithLastTab", false);
user_pref("browser.tabs.insertRelatedAfterCurrent", false);
user_pref("browser.urlbar.maxRichResults", 0);
user_pref("browser.cache.disk.enable", false);
user_pref("browser.cache.memory.enable", true);
user_pref("browser.cache.memory.capacity", 1048576);
user_pref("browser.sessionstore.interval", 15000000);
user_pref("dom.webnotifications.enabled", false);
user_pref("extensions.pocket.enabled", false);

// Added 2022-11-13 by JJS
user_pref("browser.tabs.firefox-view",false);

A "user.js" file is used in Firefox to store custom settings, just like going into the about:config page. For example the first line "layout.css..." changes the screen resolution. The next line forces FF to remain open when the last tab is closed rather than shut down.

Each user_pref is one of the settings in "about:config"

Depending on your screen (and your eyes) you'll probably want to play with the first user_pref("layout.css..." or comment it out entirely.

The "Min" note I mentioned in the first code block was a note to myself because this is my "minimal" user.js configuration. I've got other versions for different things, but this code block is in all of them. So you can ignore that.

Just use your favorite text editor to create a text file named "user.js". Copy that code into it. Save it and put the file into a firefox profile directory. When you start that profile the config settings in "user.js" will override whatever is in the "about:config".

Does this help?

As for the list of "about" notes, those are similar to "about:config" except they all you to see some of the hidden workings inside FF. For example, "about:performance" is the FF Task Manager. It will show you everything loaded and the impact on memory and speed. About:profiles will show you the list of profiles you've created and info on each
Locked

Return to “Software & Applications”