Google Chrome - Reduce disk access to increase speed in USB drive

Issues and / or general discussion relating to Puppy

Moderator: Forum moderators

Post Reply
trister
Posts: 89
Joined: Mon Sep 28, 2020 6:52 am
Has thanked: 18 times
Been thanked: 15 times

Google Chrome - Reduce disk access to increase speed in USB drive

Post by trister »

Hello,
After many years of running puppy/dog linuxes I have pinpointed the main major factor that slows surfing is the Google Chrome writing of data & cache in drive.

I tried moving the whole OS to a simple USB3 and when I tried to browse using google chrome I had major slowdown issues (NOTE: I have 4GB and i5).

The current solution that I use is an external SSD drive and speed is amazing.
If I move the same frugal install to a medium USB3 stick then when I open chrome surfing hangs for seconds many times.

I know that the slowdown is from the slow write speed of the USB.

Is there a Chrome parameter that will reduce disk usage with Google Chrome?

Thanks in advance

User avatar
fredx181
Posts: 2593
Joined: Tue Dec 03, 2019 1:49 pm
Location: holland
Has thanked: 281 times
Been thanked: 1011 times
Contact:

Re: Google Chrome - Reduce disk access to increase speed in USB drive

Post by fredx181 »

Something like this perhaps ?
google-chrome-stable --disk-cache-size=10000000 --media-cache-size=10000000

User avatar
ETP
Posts: 88
Joined: Mon Jul 20, 2020 8:21 pm
Location: UK
Has thanked: 19 times
Been thanked: 88 times

Re: Google Chrome - Reduce disk access to increase speed in USB drive

Post by ETP »

Hi @trister & fredx181,

You are not short of memory with 4GB so can bypass the drive speed issue totally by
placing the cache in RAM which is faster than any NVME, SSD, hard drive or USB3 stick.
The cache will be cleared when you reboot or on a manual ad hoc basis during a chrome session.
The type of install and user (spot/root) do not matter.

Code: Select all

google-chrome-stable --disk-cache-dir=/tmp/cache
Regards ETP
Current go-to Pup since Feb 2019 - BionicPup64 8.0
Video - https://photos.app.goo.gl/HYLupyMGcQFP81z69

On test - Ubuntu Cinnamon Remix 20.10 (Groovy Gorilla)
Video - https://photos.app.goo.gl/xGbQYtioXt6mzoi48
trister
Posts: 89
Joined: Mon Sep 28, 2020 6:52 am
Has thanked: 18 times
Been thanked: 15 times

Re: Google Chrome - Reduce disk access to increase speed in USB drive

Post by trister »

Thank you both. :)
I have tried both solutions in the past.
Initial I tried fred's solution but it didn't make much difference because the delay was caused by the many different small files that cache writes. With this solution I kept having many thousands of files in cache folder. I tried to find a parameter that limited number of files but did not found any.

About ETP solution I did try this in the past but not with many tests. I think this solved half the problem but I did have some issues with the user-data folder.

My current command :

Code: Select all

sudo -u puppy google-chrome-stable --user-data-dir=/home/puppy/.data/google-chrome-stable_puppy_user_data_dir --disk-cache-dir=/home/puppy/.cache/google-chrome-stable_puppy_user_cache_dir --media-cache-size=10000000 "\$@"
Last edited by mikewalsh on Mon Apr 18, 2022 11:01 pm, edited 1 time in total.
Reason: Spelling corrections, and adding code tags to make easier reading for others in future...
User avatar
xenial
Posts: 504
Joined: Mon Jul 13, 2020 7:41 am
Location: Lincolnshire.UK.
Has thanked: 92 times
Been thanked: 41 times

Re: Google Chrome - Reduce disk access to increase speed in USB drive

Post by xenial »

have you perused the chrome://flags to see if some caching can be disabled.If i am correct chrome relies on pre-fetching and caching to give it the supposed speed.

Also there is a way of turning off caching but it means opening the devtools window permanently.
I think firefox and firefox based browsers do have an advantage here by having the ability to disable cache but it comes at the expense of bandwith and speed reductions especially if you are on a limited network speed.

Just out of curiousity and i am not sure if it is feasible but can the chrome cache directory be made read only.... :shock: :shock:
Might have disastrous results but experimentation is all good... :D :D

trister
Posts: 89
Joined: Mon Sep 28, 2020 6:52 am
Has thanked: 18 times
Been thanked: 15 times

Re: Google Chrome - Reduce disk access to increase speed in USB drive

Post by trister »

trister wrote: Thu Apr 14, 2022 9:26 am

About ETP solution I did try this in the past but not with many tests. I think this solved half the priblem but I did have some issues with the userdata folder.

I did some more tests. With userdata on the USB and Cache in RAM chrome still has incredible delays...

User avatar
fredx181
Posts: 2593
Joined: Tue Dec 03, 2019 1:49 pm
Location: holland
Has thanked: 281 times
Been thanked: 1011 times
Contact:

Re: Google Chrome - Reduce disk access to increase speed in USB drive

Post by fredx181 »

Note that on Puppy /tmp is probably a RAM disk but not on DebianDog by default, perhaps try /dev/shm OR /mnt/live (RAM disk)
See df -h | grep tmpfs
E.g:
root@live:~# df -h | grep tmpfs
Filesystem Size Used Avail Use% Mounted on

tmpfs 1,9G 1,9M 1,9G 1% /mnt/live
devtmpfs 10M 0 10M 0% /dev
tmpfs 2,3G 52M 2,2G 3% /mnt/live/memory/changes
tmpfs 376M 864K 375M 1% /run
tmpfs 5,0M 4,0K 5,0M 1% /run/lock
tmpfs 752M 29M 723M 4% /dev/shm
tmpfs 376M 4,0K 376M 1% /run/user/0

trister
Posts: 89
Joined: Mon Sep 28, 2020 6:52 am
Has thanked: 18 times
Been thanked: 15 times

Re: Google Chrome - Reduce disk access to increase speed in USB drive

Post by trister »

I run with the EXIT: parameter so I guess everything is in RAM ..

Code: Select all

root@live:~ $ df -h | grep tmpfs
tmpfs           3,9G  4,3M  3,9G   1% /mnt/live
devtmpfs        3,9G     0  3,9G   0% /dev
tmpfs           4,6G   82M  4,6G   2% /mnt/live/memory/changes
tmpfs           3,9G   20M  3,9G   1% /dev/shm
tmpfs           1,6G  1,4M  1,6G   1% /run
tmpfs           5,0M  4,0K  5,0M   1% /run/lock
tmpfs           785M   20K  785M   1% /run/user/0
trister
Posts: 89
Joined: Mon Sep 28, 2020 6:52 am
Has thanked: 18 times
Been thanked: 15 times

Re: Google Chrome - Reduce disk access to increase speed in USB drive

Post by trister »

A parameter like EXIT: for chrome (run in ram save only on exit) would solve much speed problems and would expand HDD/USB life...

User avatar
Phoenix
Posts: 339
Joined: Fri Feb 12, 2021 2:03 am
Location: Canada
Has thanked: 4 times
Been thanked: 48 times

Re: Google Chrome - Reduce disk access to increase speed in USB drive

Post by Phoenix »

trister wrote: Fri Apr 15, 2022 4:13 pm

A parameter like EXIT: for chrome (run in ram save only on exit) would solve much speed problems and would expand HDD/USB life...

For that you'd need a wrapper script to do that. Or another utility. There's stuff on how to do this over at the Arch Linux wiki.

IRC: firepup | Time to hack Puppy!

dancytron
Posts: 655
Joined: Fri Dec 13, 2019 6:26 pm
Has thanked: 425 times
Been thanked: 190 times

Re: Google Chrome - Reduce disk access to increase speed in USB drive

Post by dancytron »

I just saw this...

This is what I run in my .desktop file to put Chrome on the /live/image/ (the Debian dog equivalent of /mnt/home).

Code: Select all

Exec=ddliveapp google-chrome-stable --disk-cache-size=10000000 --media-cache-size=10000000 --user-data-dir=/live/image/ChromeSettings/config --disk-cache-dir=/live/image/ChromeSettings/cache %U

The trick is that you have to set the folder /live/image/ChromeSettings/ so that the browser has access to it, in the case of Debian Dog so it is owned by "puppy" id (in Puppy it would be spot).

If you are having trouble doing something, try creating a subfolder and setting the permissions...

Mia_White
Posts: 8
Joined: Fri Apr 01, 2022 5:46 pm

Re: Google Chrome - Reduce disk access to increase speed in USB drive

Post by Mia_White »

thanks for the discussion

trister
Posts: 89
Joined: Mon Sep 28, 2020 6:52 am
Has thanked: 18 times
Been thanked: 15 times

Re: Google Chrome - Reduce disk access to increase speed in USB drive

Post by trister »

dancytron wrote: Sun Apr 17, 2022 8:51 pm

I just saw this...

This is what I run in my .desktop file to put Chrome on the /live/image/ (the Debian dog equivalent of /mnt/home).

Code: Select all

Exec=ddliveapp google-chrome-stable --disk-cache-size=10000000 --media-cache-size=10000000 --user-data-dir=/live/image/ChromeSettings/config --disk-cache-dir=/live/image/ChromeSettings/cache %U

The trick is that you have to set the folder /live/image/ChromeSettings/ so that the browser has access to it, in the case of Debian Dog so it is owned by "puppy" id (in Puppy it would be spot).

If you are having trouble doing something, try creating a subfolder and setting the permissions...

Thanks for the answer @dancytron!
This solution saves permanetly ChromeData at shutdown?

(actually my configuration is a bit more complex than that but this is a good starting point... - I do not save anything to change.dat .Chrome save directly to a forlder in my hard disk)
(edit)I just saw that you also save to /nmt/home/ - that is what I was doing. /mnt/home/ is in my USBdiskdrive and this creates the delays... (/edit)

dancytron
Posts: 655
Joined: Fri Dec 13, 2019 6:26 pm
Has thanked: 425 times
Been thanked: 190 times

Re: Google Chrome - Reduce disk access to increase speed in USB drive

Post by dancytron »

If you put it directly on a drive (like /mnt/sda1/chromestuff or /mnt/home/chromestuff or in DD /live/image/chromestuff, it saves in real time. If you put it in the filesystem, like under /root/chromestuff or /opt/chromestuff, then it saves when you click the save button or on exit if you are Pupmode 13 and therefore have the save button.

In Puppy it would be (I think off of the top of my head) it is run-as-spot not ddliveapp or run-as-user.

Post Reply

Return to “Users”