So apparently excessive disk writes (on the order of multi-gigabytes per day) has been an issue with FF for a very long time.
I only became aware of this issue while optimizing my new Linux workstation where the Gnome System Monitor helpfully shows total disk writes per process. I was shocked at how much activity FF exhibited (>500 MiB disk writes) for only 15min of active use (loading a scant few web pages while configuring my setup).
Confused, but not necessarily alarmed, I attempted a search to see if I was just being paranoid (or whatever the computer equivalent of a hypochondriac is). Turns out that other people have noticed this behavior and have tried to curtail the write activity by editing setting in FF's about:config page:
https://www.servethehome.com/firefox-is-eating-your-ssd-here-is-how-to-fix-it/https://www.reddit.com/r/firefox/comments/ufozuh/disable_browser_cache_in_firefox_so_you_dont/?rdt=62421browser.sessionstore.interval - 1800000
browser.cache.disk.enable - false
browser.cache.disk_cache_ssl - false
and so on...
I had no luck with lessening FF's excessive write behavior using any of these options in about:config. On the other hand, these settings
did help with Tor Browser, which is based on FF and has similar issues with massive disk writes for what amounts to ephemeral throw away browser sessions.
Que dramatic music: Arch Wiki and Profile-sync-daemon enter the chat.
https://wiki.archlinux.org/title/Firefox/Profile_on_RAMhttps://wiki.archlinux.org/title/Profile-sync-daemonTurns out the bulk of the disk activity is in the FF profile directory. This directory isn't very large, maybe 100 to 300 MiB, but the massive amount of activity it sees is surprising. Turns out moving this directory to a RAM disk solves the disk write issue and also speeds up FF. A real win-win. Do note that there is the possibility of losing session data (i.e. opened, unsynced tabs) in the event of a crash, power outage, or other disruption. So, like with all "fixes", there are caveats to consider.
So PSD neatly covers FF (and other browsers) for Linux. But what about Windows?
Well, I'm glad you asked, because I believe I have a pretty neat turn-key solution to this problem. And its very low effort too. But first, let's figure out how to profile this on Windows. Unfortunately, Windows Task Manager does not show total disk writes per process; however, Sysinternals Process Explorer does. Nice. That's step one. Next we need to see where writes are being made. Well, Windows Resource Monitor or Sysinternals Process Monitor can do this for us. I chose the later. Let Process Monitor run for a little bit then go to "Tools" -> "File Summary". This will show a list of all file activity since it has been running (so you may want to open and close Process Monitor periodically to speed things up). This lets us know what FF is doing and where its doing it. Finally we need CrystalDiskInfo. This utility lets us see the SSD's TBW metric in gigabytes, and is how we will prove that moving the profile directory into RAM actually does anything useful.
As shown above, I logged over 10 gigs of pointless writes to disk in less than 6 hours on my Win10 laptop! The laptop was docked and set to not go to sleep, since it was plugged into AC power. Firefox was ironically idle during much of this time. According to Windows Resource Monitor, some websites cause FF to exhibit persistent megabytes/second disk activity with zero user input. Wild.
This attachment shows FF profile activity on a RAM disk I made with drive label P. Clever, I know.
Okay, you've sold me! So how can I fix this on Windows? Well, it's pretty easy:
1) Download and install ImDisk Toolkit (
https://sourceforge.net/projects/imdisk-toolkit/)
2) Close FF. Go to C:\Users\YOURUSERNAME\AppData\Roaming\Mozilla\Firefox and edit the two .ini files:
installs.ini:
add P:\ after Default=
(so we should see "Default=P:\SOMEVALUE.default-SOMEVALUE")
profiles.ini:
set IsRelative=0
add P:\ after Default= and Path= (like we did for installs.ini)
Note: YOURUSERNAME is your account user name.
3) Setup a persistent 500MiB* RAM disk that copies your FF profile into memory and then saves it back to disk upon system shutdown or reboot. Yeah, this is the meat and potatoes bit. (*the disk takes up only as much space as need, so <500MiB in practice)
Open Start, find the ImDisk subfolder and open RAM DiskConfiguration and input the settings in attachment 3.
Note that the FF profile directory is located at:
C:\Users\YOURUSERNAME\AppData\Roaming\Mozilla\Firefox\Profiles
ImDisk will copy the contents of this directory to the new RAM drive P and sync files at boot/shutdown. Easy, peasy.
Now open up FF. It will complain and ask you to setup your profile (since we edited the .ini files).
Select Create Profile. Direct FF to the P drive and select your profile folder. FF should open up with all your saved tabs.
If you made a mistake selecting the correct profile or directory: close FF, edit the .ini files again as per step 2) and reopen FF.
Note: To check that the profile on the P drive is being used, open up Process Monitor and look for FF activity on the P drive. (To simplify profiling, we can create a filter in Process Monitor to only show FF activity. Click Filter on the top bar then Filter on the drop down selection. Now change Architecture to Process Name and type firefox.exe in the blank box. The filter should show "[Process Name] [is] [firefox.exe] then [include]". Click OK to apply the filter.)
4) Set the new RAM drive to hidden. Go back to Start, ImDisk subfolder, open General Settings and check the box for P. Done.
So there you have it: PSD on Windows is basically ImDisk and a few file edits and redirecting FF to the new directory location. Neat.