Save SSD by disabling session restore ou increase session store intervals

Users and developers helping users with generic and technical Pale Moon issues on all operating systems.

Moderator: trava90

Forum rules
This board is for technical/general usage questions and troubleshooting for the Pale Moon browser only.
Technical issues and questions not related to the Pale Moon browser should be posted in other boards!
Please keep off-topic and general discussion out of this board, thank you!
User avatar
feraritn
Moongazer
Moongazer
Posts: 13
Joined: 2022-08-03, 11:11

Save SSD by disabling session restore ou increase session store intervals

Unread post by feraritn » 2022-08-04, 15:23

Hello, Hello, i discouver this surprising article of 2016, it wil be great to save our hard disk and battery to add an option to disable session restore or increase session store intervals, i have made search, i found eventuel solution but it is very complicated , may be it can help, please add option to quickly disable completely session restore, many don't need this feature, we just use browser to watch some videos.....

Thank you in advance !

"Firefox (& Chrome) are eating our SSD's?!"

"Heavy SSD Writes Firefox is eating your SSD"



"Firefox and Chrome can shorten SSD lifetime
September 26, 2016

Firefox and Chrome have been found to continuously write so much data that it might affect the durability of SSDs. Both browsers write an incredible amount of data to disk, even when idle.

firefox-with-32gb-written-in-a-single-day

This was discovered by researcher Sergei Bobik who used the software SSDLife to monitor how much data was read and written on his system. He found both browsers write a lot of data as they continuously make a backup of themselves"


https://myce.wiki/news/firefox-chrome-c ... ime-80534/

https://forums.linuxmint.com/viewtopic.php?t=235651

https://www.servethehome.com/firefox-is ... to-fix-it/



"reduced to using Chrome, below is what is going on inside Firefox, it says Chrome does the same thing. I dont need this garbage of Chrome writing the whole page to my micro SD every 15 seconds.
Has anybody found, useing a work around for Chrome, when I looked on the net I could not find anything about Chrome, it was all FF."



"by Nominal Animal
Before switching to a laptop with a really, really fast SSD, I used to keep my active browser profiles on a ram disk (tmpfs).

Essentially, when inactive, your Firefox profile can be stored in a tarball (~/.mozilla/firefox/profilename.default.tar). When active, the contents of the tarball are extracted to a temporary directory on a tmpfs mount (ramdisk), with the ~/.mozilla/firefox/profilename.default pointing to that directory. The only real limitation of this approach is that you'll want to set the maximum cache size to something small; I happily used 0, 32 and 64 megabytes for years. (The no-cache one I used on a 2009 Acer Aspire One A110L minilaptop. It still works fine for casual web browsing.)

There are two approaches to maintaining such Firefox profiles.

First approach is to construct it at login, and deconstruct/repack it at logout. This is managed via a session manager script, and varies slightly between session managers. (I tried to get the necessary hooks for doing this in a transparent, safe manner to GDM, but got fed up with the lack of interest, and switched to LightDM.) The downside is that the profile is in memory even when you don't have a browser open, and if you keep yourself logged in all the time, the tarball version of the profile never gets updated.

Second approach is to customize or interpose /usr/bin/firefox (or /usr/bin/firefox-esr). It is a launcher shell script for Firefox. In it, the exec $MOZ_LIBDIR/$MOZ_APP_NAME "$@" causes the script to replace itself with the actual Firefox binary. If you edit the script, or use your own copy of the script, with the exec removed, the shell will remain in memory while the browser is still running. (In this case, I recommend using dash as the shell, if possible, for minimal resource use.) Before running the browser binary proper, the scriptlet checks if the session symlink points to a valid directory. If not, it sets it up. After the browser binary exits, the script tests if there are no more instances left (ps -o pid= -C firefox or ps -o pid= -C firefox-esr), and if not, re-tars the profile, and removes the temporary profile directory. (I preferred to use sync to ensure the data hits the disk, and notify-send to pop up a notification whenever the profile was safely stored on disk. That way, after making a number of new bookmarks or such, all I needed to do was to close and reopen the browser windows, to be sure they were safely stored on disk.)

For further information, search for firefox profile tmpfs and/or firefox profile ram with your preferred web search engine.
Top


Gee wiss nominal animal, thats a long answer. I was asking about chrome. Go to 'firefox 55 crashing' to see what the experts say to do if you are using a solid drive.


oldchap wrote:
I was asking about chrome.

The approach I used with Firefox years ago works fine for chrome, too."




https://forum.odroid.com/viewtopic.php?t=29810

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35477
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: Save SSD by disabling session restore ou increase session store intervals

Unread post by Moonchild » 2022-08-04, 15:57

  1. NAND storage has improved a lot in the past 6 years
  2. Pale Moon already has a more conservative sessionstore interval of 1 minute
  3. Reducing your web cache will actually cause more writes, not less, as there will be more turnover of data
  4. If you "just use it to watch video" then you're likely writing a lot more data to disk by that than you'd ever do through web cache or sessionstore writes
  5. If you do the math, then you'll see that writing even as much as 32 GB/day to an SSD does not significantly impact your normal use of them (32GB/day = 11680 GB/year. A 1TB (1000GB) SSD with an average 3000 write cycles and taking the SSD write overhead factor into account of 5, both of which are slating the calculation disadvantageous, would make that SSD last (3000x1000)/(5x11680) = 51 years... Are you really concerned about that? 8-)
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

User avatar
athenian200
Contributing developer
Contributing developer
Posts: 1498
Joined: 2018-10-28, 19:56
Location: Georgia

Re: Save SSD by disabling session restore ou increase session store intervals

Unread post by athenian200 » 2022-08-04, 16:45

I have an SSD from 2012, and it's at 83% health after 10 years of fairly heavy use and reinstalling operating systems multiple times. I think if the browsers were putting that much wear and tear on SSDs, it wouldn't have lasted that long.

The idea that SSDs have a limited lifespan freaks people out a lot more than it should. Maybe a spinning drive theoretically can last indefinitely as long as there's no mechanical failure, but in practice I find that the moving parts and bad sectors on a mechanical drive have lost me a lot more data over the years than any SSD or flash storage device I've ever used.

I think people don't like SSDs for the same reason it would be upsetting to know when you are going to die, or to have an hourglass representing your lifespan that drains faster when you do certain things. People are more comfortable with death coming randomly, always have been.
"The Athenians, however, represent the unity of these opposites; in them, mind or spirit has emerged from the Theban subjectivity without losing itself in the Spartan objectivity of ethical life. With the Athenians, the rights of the State and of the individual found as perfect a union as was possible at all at the level of the Greek spirit." -- Hegel's philosophy of Mind

Locked