Firefox writes megabytes of data per minute to disk, why?
iotop -a
(accumulated I/O) on Linux shows after about 10 min. of browsing Internet:
Total DISK READ: 0.00 B/s | Total DISK WRITE: 0.00 B/s
TID PRIO USER DISK READ DISK WRITE> SWAPIN IO COMMAND
17330 be/4 wojdyr 1540.00 K 38.48 M 0.00 % 0.00 % firefox
403 be/3 root 0.00 B 31.65 M 0.00 % 0.06 % [jbd2/sda5-8]
17276 be/4 wojdyr 800.00 K 31.06 M 0.00 % 0.00 % firefox
17329 be/4 wojdyr 0.00 B 20.96 M 0.00 % 0.00 % firefox
31896 idle wojdyr 0.00 B 1200.00 K 0.00 % 0.00 % virtuoso-~.ini +wait
31924 be/4 wojdyr 0.00 B 1064.00 K 0.00 % 0.00 % akonadi_n~ail_feeder
18959 be/4 wojdyr 0.00 B 796.00 K 0.00 % 0.01 % firefox
I'm quite surprised by the amount of data written to disk. I turned off to-disk caching, but it didn't make notable difference. I turned off block-reported-attack-sites
/web-forgeries
-- nothing changed.
Is this rate of writing to disk normal in Firefox (10.0.1)? It quickly exceeds the total size of my firefox profile.
Looking at modification times of files in the firefox profile I see that a few files are modified very often:
cookies.sqlite{-wal,-shm}
sessionstore.js
places.sqlite{-wal,-shm}
permissions.sqlite
Is there something wrong with my system or configuration, or is it typical for FF?
I don't like this pointless writing to (SSD) disk. Can I do something about it?
EDIT: I've found this guide how to relocate the entire Firefox profile to RAM. It reduced almost to zero data written by firefox during session. (I know this is a bit paranoid and probably not worth the hassle.)
I did an investigation of where writes to my SSD come from. I found the same thing you did. After analyzing logs of writes as well as thinking about things I realized that it is Firefox's crash recovery. In order to be able to recover from a crash Firefox has to write the session to disk. The session information is stored in the four files you listed. Firefox updates these every ~30 seconds. With lots of tabs in a big session this adds up to a few GB per day.
But as surfasb says, it is not really anything to worry about.
There is a setting in Firefox that controls how often the session restore saves files. Go to about:config
and change:
browser.sessionstore.interval to change how often the session is saved. On my system, the default was 15000 (milliseconds) so it was writing to disk every 15 seconds. If you increase this to 300000, it will only write every 5 minutes.
browser.sessionstore.enabled can be turned to
false
to disable this feature completely. This will reduce the amount of disk writes Firefox does, but this will also prevent Firefox from restoring your session when it crashes.
After loading about 10 pages and some in Chrome mine looks like this:
So I guess that's normal swap/page file use.
(Although one would think with me only using 31% of RAM it wouldn't swap at all.)
FF was writing to disk constantly at 2.5+ MB/s! I ran sudo iosnoop -p PID
and found that the Evernote Web Clipper was doing all the writing. I removed it and disk writes went down to 0 to a few kb/s.