1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Firefox is chewing through your NAND

Discussion in 'Software Stuff' started by keybored, Sep 18, 2016.

  1. keybored

    keybored Active Member

    Joined:
    May 28, 2016
    Messages:
    169
    Likes Received:
    39
    Apparently things are worse than I originally thought and "recovery.js" isn't the only file involved. In case someone wants to replicate, here's what I did this morning. I reset browser.sessionstore.interval to 15000 and then got rid of all my currently open FF windows. Opened a single window with just Google running in it, left it sitting for a couple of minutes, and then closed it. Started the browser again and on this final restart the recovery.js file was only 5KB in size, down from around 900KB before.

    Next, I opened a bunch of random reviews for Samsung 850 pro and Samsung Galaxy S7 in two separate windows. Literally just googled "samsung 850 pro review" and "samsung galaxy s7 review" and then went down the list of results opening them in new tabs. Opened a 3rd window and created a bunch of tabs showing front pages for various news sites.

    firefox-disk-activity-windows-1.jpg
    Recovery.js at this point was at ~60KB.
    Launched Process Monitor and configured it to track recovery.js and cookie* files:

    firefox-disk-activity-process-monitor-config-1.jpg

    Went to File->Capture Events and disabled it. Cleared all events that were currently showing up. Went back to File->Capture Events and re-enabled it. Left the three FF windows sitting idle for 45 minutes while I was using Chrome instead. Then I went to Tools->File Summary to get overall stats. Firefox managed to write 1.1GB to disk with the vast majority of data going into cookie* files.

    firefox-disk-activity-file-stats-1.jpg

    Note that recovery.js managed to accumulate only about 1.3MB of writes.

    Went back to one of the Firefox windows and opened my outlook.com mailbox. Cleared all events in Process Monitor and re-started the capture. Again, left all Firefox windows sitting idle, but only for ~10 minutes. This time recovery.js was at ~1.5MB and it took only about 1/4-th of the time to get there. Cookie* files had a ton of data written to them, as before.

    firefox-disk-activity-file-stats-2.jpg

    So, looks like depending on what you've got open in your tabs, Firefox could be dumping tons of data into recovery.js, cookie* files, or both. Running at 1.1GB for every 45 minutes, you're looking at ~35GB/day written to your SSD if you leave your machine running. And at least in my case this wasn't even the worst example of how much data could be going into recovery.js. In my original tests I clocked Firefox at 2MB/s writing to this file and the writing thread never went dead always showing up on the top of the list in Resource Monitor.
     
    #21
  2. cheezehead

    cheezehead Active Member

    Joined:
    Sep 23, 2012
    Messages:
    439
    Likes Received:
    90
    What happens when you run with private browsing enabled?
     
    #22
  3. T_Minus

    T_Minus Moderator

    Joined:
    Feb 15, 2015
    Messages:
    4,873
    Likes Received:
    874
    At first I just laughed and thought no way... but now, I have no reason as to why my writes are so high. Which, now makes me wonder if most of my writes are from FireFox.

    My Samsung 950 Pro 256GB primary OS drive (Windows 10).

    I believe I installed it around December 2015 is showing 3.56 TBW as of 9-21-2016 (9:05 AM PST).

    I only have 1.5Mbit internet so I don't write to it much, in the last couple months I've written maybe 50GB of video being 'large' data I've dealt with on my local desktop. My games are on other SSD. My storage is on my network. I have downloaded approx 110GB of files through my Desktop since Dec. 2015.

    With that said, I somehow write almost 4TB in less than 12 months. I know Windows 10 may be worse than Windows 7, but I disabled a lot of win10 features both within windows and with 3rd-party/edits so I know it's not caching, etc,...




    @keybored I'll be looking into running some of those tests / monitoring the way you did and report back.
     
    #23
  4. keybored

    keybored Active Member

    Joined:
    May 28, 2016
    Messages:
    169
    Likes Received:
    39
    There was virtually no activity with that set of files when I opened the same tabs in a private browsing session. It's either keeping most of the stuff in memory or saving it in a different set of files that are not being monitored.
     
    #24
    tukoz likes this.
  5. cheezehead

    cheezehead Active Member

    Joined:
    Sep 23, 2012
    Messages:
    439
    Likes Received:
    90
    Could filter on the process accessing the file system instead of the specific path with private browsing.
     
    #25
  6. Jame5

    Jame5 New Member

    Joined:
    Aug 19, 2016
    Messages:
    2
    Likes Received:
    5
    As an aside, this behavior is not new.

    Back in 2010 on Linux, I wrote a script that on boot, would load my .mozilla/firefox folder to tmpfs. Once an hour, it would sync back the tmpfs copy to disk.

    Why did I do this? At first, it was because Firefox was so spammy with writes to that sqlite database that it bogged down the spinning disk I was using at the time. Aft upgrading to an SSD, I kept the script in place, simply because I knew that Firefox was constantly pounding that database file, and didn't want it wearing out my (then fancy) OCZ 30GB SSD that I was using for my base OS drive.

    There was a lot of back and forth about Firefox using sqlite to store information and how it was chewing up I/Os on systems back then. It's funny that this has now become a reportable issue yet again.
     
    #26
    keybored, T_Minus and NetWise like this.
  7. Patrick

    Patrick Administrator
    Staff Member

    Joined:
    Dec 21, 2010
    Messages:
    8,657
    Likes Received:
    2,458
  8. T_Minus

    T_Minus Moderator

    Joined:
    Feb 15, 2015
    Messages:
    4,873
    Likes Received:
    874
    This may explain issues people have with their parents' computers... I know my parents use their desktop for browsing and outlook 90% or more of the time, and often 5-8hrs a day spread throughout, tons of tabs, and multiple windows.

    FireFox and retiree hard drive killer...
     
    #28
  9. Patrick

    Patrick Administrator
    Staff Member

    Joined:
    Dec 21, 2010
    Messages:
    8,657
    Likes Received:
    2,458
    upload_2016-9-23_9-38-32.png

    Looks like Chrome writes a lot too: 78 tabs open across 3 windows.
     
    #29
  10. wildpig1234

    wildpig1234 Member

    Joined:
    Aug 22, 2016
    Messages:
    355
    Likes Received:
    24
    Thanks for the info.... I have to say I m horrified... I would rather not have any recovery files and zero write to my ssd if I have to pick. ... wtf is wrong with all the browser companies? Dont they realize that most people nowaday have ssd as their boot drive?

    Gonna hv to install that software asap tonite ti check.... I use ie and chrome and edge... does anyone know if those 3 do anything like this ?
     
    #30
  11. keybored

    keybored Active Member

    Joined:
    May 28, 2016
    Messages:
    169
    Likes Received:
    39
    What's interesting to me is that nothing has evidently been done about this if the issue has been known since 2010.
    What I'm also finding out is that this Firefox behavior while idle is only one side of the coin. These cookie* files are being written to with every click/page load. Tracked a few clicks yesterday and each one cost at least 1MB in writes. 10 clicks -- 10MB written to your SSD...
     
    #31
  12. Patrick

    Patrick Administrator
    Staff Member

    Joined:
    Dec 21, 2010
    Messages:
    8,657
    Likes Received:
    2,458
    #32
  13. PigLover

    PigLover Moderator

    Joined:
    Jan 26, 2011
    Messages:
    2,281
    Likes Received:
    765
    I think the better solution is stop using Firefox. It used to be lean and tight and better than the others, but over the last 2-3 years its become fat and bloated and something of an also-ran.

    Except at work - where a quirky firewall issue ties my hand - I've moved on to Chrome and not looked back. Using Firefox at the office reminds me every day that this was a good decision.
     
    #33
  14. Patrick

    Patrick Administrator
    Staff Member

    Joined:
    Dec 21, 2010
    Messages:
    8,657
    Likes Received:
    2,458
    30 minutes into the session over 350MB written with Chrome. That is a 16GB/ day pace. Seems like the local cookies stores are the largest offenders.
    upload_2016-9-23_10-26-53.png
     
    #34
  15. cheezehead

    cheezehead Active Member

    Joined:
    Sep 23, 2012
    Messages:
    439
    Likes Received:
    90
    I've been still using FF heavily but have migrated with FF and Chrome to using private browsing normally to reduce the disk I/O.
     
    #35
  16. Patrick

    Patrick Administrator
    Staff Member

    Joined:
    Dec 21, 2010
    Messages:
    8,657
    Likes Received:
    2,458
    ~1GB/ hour was the final tally.
    upload_2016-9-23_11-19-0.png
     
    #36
    tukoz likes this.
  17. Jame5

    Jame5 New Member

    Joined:
    Aug 19, 2016
    Messages:
    2
    Likes Received:
    5
    Went ahead and rebuilt my firefox to tmpfs file.

    Adding a cron for @reboot and every half hour.

    Code:
    #Firefox to tmpfs onboot cron
    @reboot /home/jsmith/scripts/firefox_tmpfs
    
    #Firefox every half hour tmpfs to disk sync
    */30 * * * * /home/jsmith/scripts/firefox_tmpfs
    
     

    Attached Files:

    #37
    ServiceComputers and Patrick like this.
  18. G-R-M

    G-R-M New Member

    Joined:
    Sep 23, 2016
    Messages:
    2
    Likes Received:
    0
    See browser.sessionsstore.enabled:

    Since Firefox 3.5 this preference is superseded with setting browser.sessionstore.max_tabs_undo and browser.sessionstore.max_windows_undo to 0.

    ----------------------------


    CrystalDisc Info says about my Samsung 840 Pro:

    Total LBAs written: 11782606898
    Power-on hours: 11549


    When my computer is turned on, Firefox is almost always running with five till 15 opened tabs.

    11782606898 LBAs. One LBA is 512 Bytes, isn't it? Then 11782606898 LBAs should be round about 5620 GB, or 5.5 TB.

    Round about 0.49 GB per hour.

    Edit:

    If you frequently cleanup your profile, you also can write those preferences into the file "user.js". I will write the modified preference "browser.sessionstore.interval" to user.js.

    Edit 2:

    Naturally my 0.49 GB cannot be compared with yours, because there are other programs that write to my SSD.
     
    #38
    Last edited: Sep 23, 2016
  19. keybored

    keybored Active Member

    Joined:
    May 28, 2016
    Messages:
    169
    Likes Received:
    39
    Was that with the browser sitting idle with a bunch of tabs open or were you actively using it?
     
    #39
  20. Fritz

    Fritz Well-Known Member

    Joined:
    Apr 6, 2015
    Messages:
    1,445
    Likes Received:
    255
    So how does one turn it off??
     
    #40
Similar Threads: Firefox chewing
Forum Title Date
Software Stuff Question about Firefox browser.sessionstore setting Oct 29, 2016

Share This Page