Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to increase the size of cache to improve performance and use less cpu resources on our old mechanical HHDs #1043

Open
trimechee opened this issue Dec 7, 2024 · 12 comments
Labels
enhancement New feature or request

Comments

@trimechee
Copy link

trimechee commented Dec 7, 2024

Hi, I notice it by opening the 2 web browsers, R3dfox opens in the blink of an eye in my old eee pc, while Supermium takes more time to open and the eee pc freezes for a while, I investigated and this difference in speed and impression of lightness comes from the fact that firefox made the good intelligent decision to increase the default cache size from 200mb to 1000mb (1 Gb), which is reflected in the speed of the web browser especially in our old laptops which have a mechanical HDD, while chromium seems optimized more for modern fast SSD and the default cache size of Supermium does not exceed 300mb which is sad because it slows down performance on our mechanical HDD, I tried this command line with Supermium :

--disk-cache-size=1147483647

to increase the default cache size of supermium to 1GB, but I go to the history section and click clear history and I see the cache size of Supermium which remains fixed at 200 MB or 300 MB even with this comand line , so the command --disk-cache-size=1147483647 is not compatible with Supermium and we hope please an easy quick option to increase the default cache of Supermium to 1Gb, or maybe our beloved Supermum should to differentiate itself from chrome's decisions and increase the default cache size to 1Gb as is the case for firefox, thank you!

let's be clear, Supermium is fast even with only 200mb cache, but I feel that r3dfox is a bit lighter and speed probably because it has a large cache of 1GB by default

@trimechee trimechee added the enhancement New feature or request label Dec 7, 2024
@trimechee trimechee changed the title Add option to increase the size of cache to improve performance use less resources on our old mechanical HHDs Add option to increase the size of cache to improve performance and use less cpu resources on our old mechanical HHDs Dec 7, 2024
@billi857
Copy link

billi857 commented Dec 8, 2024

Using the HDD cache, on the contrary, creates additional slowdowns in the browser, especially on weak hardware and low-speed HDDs (5400 rpm). A lot of time is spent reading and writing information.

If there is a lot of RAM, then it is better, on the contrary, to avoid caching on the HDD as much as possible, using the following flags: --disable-application-cache --media-cache-size=1 --disk-cache-size=1
I don't know if they are all supported now.

You can also use the browser in incognito mode and compare the speed in normal mode.

@win32ss
Copy link
Owner

win32ss commented Dec 8, 2024

Cache size is capped to about 320 MB in Chromium, but I did notice a feature that is disabled by default, named WebUICodeCache (accessed by --enable-features=WebUICodeCache), which creates a separate cache for WebUI components in addition to JavaScript and WebAssembly caches. However the maximum size for the cache is 5 MB because there are relatively few WebUI pages being accessed.

--disable-application-cache and --media-cache-size have been removed.

How does Firefox behave with smaller caches for you?

@trimechee
Copy link
Author

I did a lot of experimentations on the chromium cache, hoping to increase the cache network buffer to improve streaming, nothing worked because I concluded that it is the website server that determines the quantity of the streaming cache buffer ....

I also did experimentation to make chromium faster by deleting the cache so that the cache is only in the ram, and experimentation to increase the chromium cache, to avoid wear of the hard cache, it says the cache limit is 2GB, maybe by moving the cache from the chromium path to another folder, the disk cache command would work, I did not try with suprermium because I do not like to change the default values ​​to avoid possible bugs:

--disk-cache-dir="C:\cache" --disk-cache-size=2147483647 --media-cache-size=2000000000

for fiefox, I did some experimentation, it's a bit longer but you can choose the cache size permanently, or completely disable the cache:

browser.cache.disk.smart_size.enabled FALSE

MANDATORY RESTART OF FIREFOX

browser.cache.disk.enable

browser.cache.disk.capacity

browser.cache.disk.max_entry_size

browser.cache.disk_cache_ssl

before I hated the cache, because my hard drive of my main laptop which cracked was not fast and I wanted to delete the cache to use the cache in ram only, firefox was normal with a 300mb cache.....I was afraid that it would have the opposite effect expected and that the fan would become noisy if firefox had to decode each page again when I disabled the cache so I put the default values ​​back.....without cache, firefix was a fighter plane, it says only 30% of the cache is kept and that the cache can wear out the hard drive because the cache is regularly deleted....

now firefox has increased the cache and I have the impression that firefox has become even faster and lighter, probably also for the modifications to the rendering engine, the fear was that firefox would become heavy, the laptop would freeze when firefox searches for the version of the web page in the cache but firefox seems to have optimized the process and start up quickly with a cache of 1GB......

librewolf chose to disable the disk cache and librewlf is very fast, so I really don't know what is the best choice for speed, enable or disable the disk cache? I think if you have an entry-level ssd disk, to preserve it, it is better to disable the disk cache and settle for the ram cache, I have an old mechanical hdd so increasing the cache suits me I think

@MizaGBF
Copy link

MizaGBF commented Dec 8, 2024

I also did experimentation to make chromium faster by deleting the cache so that the cache is only in the ram, and experimentation to increase the chromium cache, to avoid wear of the hard cache, it says the cache limit is 2GB, maybe by moving the cache from the chromium path to another folder, the disk cache command would work, I did not try with suprermium because I do not like to change the default values ​​to avoid possible bugs

If I might suggest, have you tried a ram disk? Assuming you have enough free memory, that is.
I know it's doable because I remember trying it myself like 10 years ago (although I don't remember the details) and I know some people still do it today for some web browser games and such.

@trimechee
Copy link
Author

I have only 2GB of ram memory, but i remember firefox becomme very speed whand cache is disbaled, and user says we should disable cache because cache killS our ssd and consumes many energy lags....

it seems even if we set disk cache=0 in fiefox, disk cache is not disbaled completely for dash youtube videos, japense article talks about this suprising element about firefox cache and gives solution to really disable firefox cache and save ssd :

Japanese press article
FirefoxでYoutube見続けるとSSDが早死にする問題とその対処法
If you continue to watch Youtube on Firefox, SSD dies prematurely and how to deal with it

https://kanasys.com/tech/892

@MizaGBF
Copy link

MizaGBF commented Dec 8, 2024

That sounds weird. Someone correct me if I'm wrong but disabling the cache shouldn't cause a web browser to speed up, as you'll have to redownload stuff everytime. That's literally the point of the cache. Unless your drive is that slow, or damaged.
To be honest, if I was you, I would be way more worried about your memory. 2 GB is kind of low for modern web browsing, even assuming you're on a less memory-hungry older windows. Heavy pagination could cause wear on the long run (I actually saw it happen on a family member's laptop. It lacked memory and was paginating like crazy. The HDD, which was probably not of the highest quality, didn't last long).

Anyway, I never heard of Chromium or Firefox being able to cause signifcant wear to disks, SSD included. Maybe if we talk about back then, when SSD were new, they were way less durable. But it shouldn't be a problem nowadays and the subject was about HDD anyway.

As for your japanese article about Firefox killing SSD when watching youtube, it's not relevant to Supermium, so I'll make it short: It just sounds stupid.
The initial claim starts from seeing increased disk usage in the task manager. No methodology to check what's being accessed. It just claims to have found whole videos in the disk cache. I'm no web browser expert but that sounds like a design flaw or incompetency if that's how the browser is working.
The article is also not dated. I found a japanese discussion thread, from mid 2022 which was also doubtful of this article. My point is, even if that was true then, this behavior might have changed or been fixed since.
And, more importantly, I couldn't find other sources claiming the same thing.

@trimechee
Copy link
Author

I have a modern windows 10 computer with a larger amount of ram but the screen turns green during the summer so I now use my old eee pc windows 7 2gb ram, I didn't say I disabled the cache, I reported my impressions and the opinion of other users, try librewolf which disabled the cache, the cache is done in the ram memory only, if you have an old mechanical hdd, you can feel the difference, you say never heard of Chromium or Firefox being able to cause significant wear to disks, this problem dates back to 2016, press, users, tests, have been done and it is confirmed, leave your chrome open and inactive for a day and consult the task manager of the data consumed, now chrome and firefox have introduced a mechanism to put inactive tab on standby for a certain time but session store still consumes data when browser is active and not active, , I talked about it a lot on the page Thorium github, type keyword ssd in Thorium github:

Alex313031/thorium#61

@trimechee
Copy link
Author

@MizaGBF
image

@trimechee
Copy link
Author

@MizaGBF I report what a user or a developer said, he says the cache means heavy writing operation on the ssd and 70% of the cache is erased because the sites renew their data and he advises us to deactivate the cache in firefox, the cache will be done in the ram, even low ram will do the trick since the cache does not exceed 200 mb,

@trimechee
Copy link
Author

""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 "

@trimechee
Copy link
Author

ohh lala, I forgot, inactive idle chrome was able to consume 100GB of data per day!! do you really think it doesn't affect the ssd? and even other components of the computer that will heat up? @MizaGBF

@billi857
Copy link

billi857 commented Dec 9, 2024

--disable-application-cache and --media-cache-size have been removed.

Oh, but I still have this written in the shortcuts for launching the browser! Apparently, in vain.
Then tell me, is using incognito mode enough to avoid unnecessary caching to disk, especially when watching videos?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants