Change Firefox session store interval to save your SSD

7 Oct

Majority of our computers boot from Solid-State-Drives (SSD).  This is great for performance, but SSDs have drawbacks due to the inherit way that they work.  The main problem with a SSD is their limited number of writes. To help extend the life of the drive we should not write excessively to it.  Unfortunately this week, it was discovered that Firefox and Chrome are actually writing excessively to disk, even when you aren’t at your computer. It’s shortening the life your drive.

I heard this story on my favorite podcast, Security Now (episode 580), and wanted briefly share with you so you know how to help save your SSD. I’m not going to go into the details of how a magnetic hard drive works in comparison to a SSD, but instead just focus on the fact that your web browser is adding unnecessary wear and tear.

The Browser Problem

When we use our web browser we typically have a few browser windows open with multiple tabs open in each.  If our browser was to crash and we had tens if not hundreds of web pages open, we would be annoyed if we had to open the browser again and try to remember what pages we were on.

Firefox (and Chrome) have a Session Restore feature. The browser constantly saves the current browser state, such as how many browser windows are open, number of tabs, what URLs you are on, and the contents of each of those pages. When the browser crashes, it simply reloads all the content from the session store file as if nothing had happened.

The problem is that Firefox is saving the state every 15 seconds, but unfortunately it’s not saving it in an efficient manner. It seems to be just saving everything each time, whether it has changed or not, and it’s saving the actual contents of the page.  If you have a large page with a lot of images, etc, it’s writing all of that over and over again to disk.  It’s even saving this information when the computer is idle.

The person who discovered this left Firefox open with a few browser windows and tabs open and found Firefox writing about 10GB of data each day.  (Chrome is writing more up to 20GB a day).  That is an excessive amount of writes to your SSD.

To be fair, when this feature was implemented into Firefox, most people were on traditional magnetic disk drives so I’m sure the programmers were not really thinking writing everything to disk would be a issue. However, now that most people are using SSD this clearly is a problem.

Change your Firefox settings

The good news is on Firefox you can change this setting, so let’s just change it for now and hope that Firefox will fix this problem.

Borrowing a little from a previous post How to stop videos from autoplaying in Firefox, we can change our Firefox settings using about:config.

about:config is Firefox’s configuration page that is accessed by typing “about:config” and hitting return in a Firefox browser window.

Firefox will give this warning because there are so many settings here that if you don’t know what you’re doing and you start changing things it could break Firefox. However, we’re only going to change one setting here so it’s okay. Click “I’ll be careful, I promise!”.

Avoiding the Warranty in Firefox

Avoiding the Warranty in Firefox

 

You will see a list of configuration options. If you are interested, take a look at the options you can customize within Firefox.

List of configuration settings in about:config

List of configuration settings in about:config

We are interested in the sessionstore.interval options, so click in the search bar and type “sessionstore.interval” and you’ll see a the setting set to “15000” milliseconds (15 seconds).

 

The original sessionstore setting

The original sessionstore setting

 

We need to change this value to change the duration of the saves. For me personally, I tend to save my URLs a lot and not too concerned about saving browser state as I’d rather save my SSD.  I added two more 0’s to “1500000” which is 25 minutes. Now this may be a long time for some so pick a number that you feel comfortable with. Remember you can always change this number again in the future if you wish.

The original sessionstore setting

The original browser.sessionstore.interval value

Changed sessionstore interval value

Changed browser.sessionstore.interval value

Once you’ve chosen your number and saved, you can close the window and you are done.

Firefox is still a great browser

Despite the issue, this is a great reason to use Firefox as your primary browser because you actually have control over Firefox and can change this setting. Other browsers like Chrome are writing even more data and as far as I’m aware you can not change this value.

After making these changes, Firefox will save the browser session state less often and it will do less wear and tear on your SSD helping to prolong it’s life.

Leave a Reply

Your email address will not be published. Required fields are marked *