ungoogled-software / ungoogled-chromium

Google Chromium, sans integration with Google
BSD 3-Clause "New" or "Revised" License
20.24k stars 818 forks source link

Failure to disable cach disk with command line which causes ruin because of Heavy I/O that destroys SSD because of the cache ! #2042

Open trimechee opened 2 years ago

trimechee commented 2 years ago

OS/Platform

Windows

Installed

Compiled from source

Version

104.0.5112.81

Tested upstream?

Description

Heavy I/O

How to Reproduce?

Normal use

Actual behaviour

Excessive disk sate writes

Expected behaviour

EDIT : i discover this new feature in chromium based browsers : chrome://settings/content/siteData , so so this option can disable session store/storage and minimize the read write and data operations used by the web browsers and thus the energy and battery consumption especially when we use the web browser mainly to watch streaming videos please ?


Hello,

"Chrome and Spotify are writing over 150GB per day to my SSD."

"At the rates I'm clocking I'm actually probably closer to this group that is showing upwards of 100 GIG (yes, ONE HUNDRED GIG) of writes to my SSD PER DAY - just from leaving Chrome open even if I run the awesome extension (and BTW about the ONLY thing anyone has come up with to indicate helps this at all by sleeping tabs via the "Great Suspender" extension). "

https://bugs.chromium.org/p/chromium/issues/detail?id=176727

https://www.reddit.com/r/pcmasterrace/comments/54fft5/chrome_and_spotify_are_writing_over_150gb_per_day/

a user seems to have found a solution to avoid the wear of SSD and HHD and huge disk writes of chromium but I don't know if these flag work with the current version, another user said that the excessive storage writes date of chromium is due to cookies to save the state of cookies even in inactive state so should we disable cookies to save our SSDs ?

"I was finally able to fix the heavy disk I/O activity (while idle, and ultra heavy hdd kill while loading pages) by adding the following command line arguments in shortcut:

%pathtoyourbrowser% --profile-directory=Default --disable-cache --disk-cache-size=0 --disk-cache-dir="Z:\"

These commands should disable any kind of disk cache except for streaming multimedia - with no noticable speed diff. So the main reason why chrome eats up HDD for me was disk cache - and does so on every version on every variant with any setting in Chrome flags. There is a high chance that your chromium browser variant will not apply these commands on newer versions, however choosing an advanced browser with implemented setting for disk cache location will ensure that cache is not stored (see 360Chrome cn browser option in attachment and i think Slimjet browser also have it, just specify non-writeable location for cache storage). HDD activity while idle and loading heavy pages (example music. torchbrowser. com) in task manager down from 50% HDD to 3-4% (like in FF but FF is still lower I/O both in load and idle and while streaming multimedia). You could do the same with --incognito trick but then your visited history would never be saved.

Hope this helps someone save his HDD/SSD."

https://bugs.chromium.org/p/chromium/issues/detail?id=401391#c7

disable memory cache may be a good ideo to make browser faster but we cant't disable momory cache :

https://stackoverflow.com/questions/69286753/how-do-i-disable-chromes-memory-cache-without-devtools

It will be great if Ungoogled Browser gives us an effective option to completely disable the cache disk and even the memory disk, maybe it can cancel the excessive session store and speed up the noteooks that have an old HDD and save the SSDs!

Thanks a lot !

Relevant log output

Year 2013 and bug persist :

" Inactive chrome generate such I/O (task manager - it kills my disk)?
i/o read 8 200 000 000
i/o write 1 900 000 000

i/o pre minute is about (7% of cpu used constanly):
read + 200 000 000  + 50 0000 000

See what Chrome doing (what is it - process monitor sysinternals)?
chrome.exe  3056    0.0000000   159 914 159 914 159 914 60 792  60 792  834 834 834 n/a 0   n/a 0 "

Additional context

Untitled

PF4Public commented 2 years ago

Is it a duplicate of #2032?

trimechee commented 2 years ago

@PF4Public NO, in issue 2032, i asked option to disable session store or increase interval of session store, here, and i invite you to read the end f my message, i asked for effective solution and an easy way to activate option to deactivate the cache disk and disable the cache memory and I explain to you why I ask for this feature because I tried to deactivate disk cache and it does not always work, I will change the title of my message to avoid misunderstanding

Ph0rk0z commented 2 years ago

On linux I put the cache on a ramdisk. On windows....

trimechee commented 2 years ago

Yes, it is complicated and we are supposed to use 3rd party tools to move cache to ram, I wonder why there aren't easier ways :(

Ph0rk0z commented 2 years ago

google sucks, is why. but on windows firefox accelerates video very well and that can fully turn off cache besides ram.

trimechee commented 2 years ago

In firefox i disbale disk cache and now, i disable even memory cache and it lookts very very fast and save hard disk

tomasz1986 commented 2 years ago

This is what I use to disable most caching.

--disk-cache-size=1
--media-cache-size=1
--disable-gpu-program-cache
--disable-gpu-shader-disk-cache
--skia-font-cache-limit-mb=1
--skia-resource-cache-limit-mb=1
--v8-cache-options=none

Not sure if all of these still work though, as I remember setting this up maybe around ~2 years ago. There is more if search for "cache" at https://peter.sh/experiments/chromium-command-line-switches.

In my testing, --v8-cache-options is critical, as otherwise the browser tends to save tens of thousands of JS scripts to the disk, especially if you visit a lot of different sites.

Ph0rk0z commented 2 years ago

Why disable memory cache unless you're really short on ram. I love ram cache as the browser clears everything as soon as you kill it.

Did not know about v8 cache, need to add that to all my windows flags. On linux it would be redundant when I just set up: https://easylinuxtipsproject.blogspot.com/p/speed-mint.html#ID9 and symlink .cache there.

tomasz1986 commented 2 years ago

Why disable memory cache unless you're really short on ram. I love ram cache as the browser clears everything as soon as you kill it.

Yeah, I use the same switches on multiple devices, and some of them do have only 2 GB of RAM 😉.

For the record, some links to the actual source code, as 3rd party websites are often wrong regarding the possible options, etc.

Not sure about media-cache-size, because I can't find in the source code anymore. It used to be located right next to disk-cache-size, but it doesn't seem to be there in the current version of the code.

Edit:

media-cache-size was removed in https://chromium.googlesource.com/chromium/src/+/f99eeb0dc116a6c02383069b7cc4b2276058f6f1:

Remove the MediaCacheSize policy and --media-cache-size command line flag. (…) The DiskCacheSize policy can be used instead to control the size of the unified cache.

trimechee commented 2 years ago

@tomasz1986 Great ! thank you very much ! so flag --disk-cache-size is sufficient and overrides the media-cache-size flag?

@Ph0rk0z when I disabled memory cache because fiefox seems to become even faster when memory cache is disabled, but it says some sites may not work normally if cache disabled, so far I haven't encountered any problem

trimechee commented 2 years ago

@tomasz1986 so it's good idea to prevent wear of the hard disk to set none to the flag --v8-cache-options ?

tomasz1986 commented 2 years ago

Yes and yes. I've been playing around with these flags today, and the two

--disk-cache-size=1
--v8-cache-options=none

are probably enough to significantly reduce disk activity.

trimechee commented 2 years ago

Wonderful ! thank you very much for these precious advices :)