Live data from Hacker News

Heavy SSD Writes from Firefox

servethehome.com

181–190 of 361 posts

Re: Heavy SSD Writes from Firefox

#181
post #147

I have fixed this issue forever. I got a Thinkpad P50 with 64 gigs of ram. So, I just mount a tmpfs over ~/.cache. I actually use a tmpfs for a few things: $ grep tmpfs /etc/fstab tmpfs /tmp tmpfs nodev,nosuid,mode=1777,noatime 0 0 tmpfs /var/tmp/portage tmpfs noatime 0 0 tmpfs /home/zx2c4/.cache tmpfs noatime,nosuid,nodev,uid=1000,gid=1000,mode=0755 0 0

Are these writes happening in ~/.cache?

Re: Heavy SSD Writes from Firefox

#184
post #137

Earlier quoted context omitted.

How about this: 29 out of 30 times, save only a diff to the previous data. 1 out of 30 times, save the complete data in compressed form. (I'm guessing there must already be functionality to diff a bunch of JSON somewhere in the millions of lines of code). Though I'm sure this doesn't make usually make a dent in a SSD's lifetime. But there are still people running Firefox on low end Android phones with meager flash, a…

You also need to handle all corner cases where one of the intermediary diffs gets corrupted (you can't generally assume in a program like Firefox that data you write out is going to be readable in the future because lol common hardware). Or where the diffs are larger than a fresh snapshot. And you absolutely can't get it wrong. It's something that sounds easy until you actually try to get it coded up and shipping. I…

In the general case that's a huge pain. In this case, where you're writing a single blob to disk, you can stick a checksum at the end and you're good to go.

Re: Heavy SSD Writes from Firefox

#185
post #142

Earlier quoted context omitted.

How about this: 29 out of 30 times, save only a diff to the previous data. 1 out of 30 times, save the complete data in compressed form. (I'm guessing there must already be functionality to diff a bunch of JSON somewhere in the millions of lines of code). Though I'm sure this doesn't make usually make a dent in a SSD's lifetime. But there are still people running Firefox on low end Android phones with meager flash, a…

> How about this: 29 out of 30 times, save only a diff to the previous data. 1 out of 30 times, save the complete data in compressed form. > > (I'm guessing there must already be functionality to diff a bunch of JSON somewhere in the millions of lines of code). That is actually a good idea we haven't considered yet. A bit too brute force for my tastes, but relatively easy to implement. We would need to determine how…

Surely you'd diff the data structures in memory, not the serialized JSON; and would it really be faster to blindly write the 300mb each time than perform this diff?

Re: Heavy SSD Writes from Firefox

#186
post #67

I have been running Firefox for a long time with an LD_PRELOAD wrapper which turns fsync() and sync() into a no-op. I feel it's little antisocial for regular desktop apps to assume it's for them to do this. Chrome is also a culprit, a similar sync'ing caused us problems at my employer's, inflated pressure on an NFS server where /home directories are network mounts. Even where we already put the cache to a local disk.…

Would you be willing to post a how-to or example of doing this? I'm curious about how this trick works!

Take a look at libeatmydata. I'm doing something practically identical

Re: Heavy SSD Writes from Firefox

#187
12GB/day is about 140kB/second, or one Apple 2 floppy disk every second.

It also is about single CD speed (yes, you could almost record uncompressed stereo CD quality audio all day round for that amount of data)

All to give you back your session if your web browser crashes or is crashed.

Moore's law at its best.

Re: Heavy SSD Writes from Firefox

#188
post #126

Hi, I’m one of the Firefox developers who was in charge of Session Restore, so I’m one of the culprits of this heavy SSD I/O. To make a long story short: we are aware of the problem, but fixing it for real requires completely re-architecturing Session Restore. That’s something we haven’t done yet, as Session Restore is rather safety-critical for many users, so this would need to be done very carefully, and with plent…

Long time Netscape/ firefox user here:

1. Thanks for your work.

2. How do I really contribute? Could you link to what I need to do to start working on this now? I'm affected by this problem ame want to figure out if I can fix it.

Re: Heavy SSD Writes from Firefox

#189

Earlier quoted context omitted.

Would you be willing to post a how-to or example of doing this? I'm curious about how this trick works!

It's probably best to just disable sessionstore if you don't want it, as overwriting fsync would disable it for all operations Firefox might use, not just sessionstore.

That's exactly what I wanted to achieve; I didn't have the time or inclination to work out exactly which part of Firefox is responsible.

In my case it was not SSD wear I wanted to reduce, but the short pauses during interactive use.

Re: Heavy SSD Writes from Firefox

#190
post #126

Hi, I’m one of the Firefox developers who was in charge of Session Restore, so I’m one of the culprits of this heavy SSD I/O. To make a long story short: we are aware of the problem, but fixing it for real requires completely re-architecturing Session Restore. That’s something we haven’t done yet, as Session Restore is rather safety-critical for many users, so this would need to be done very carefully, and with plent…

How can I disable it completely?
Post reply on HN