graysky2 / profile-sync-daemon

Symlinks and syncs browser profile dirs to RAM thus reducing HDD/SDD calls and speeding-up browsers.
https://wiki.archlinux.org/index.php/Profile-sync-daemon
Other
905 stars 88 forks source link

Using zram device instead of tmpfs #357

Open eduardoeae opened 1 year ago

eduardoeae commented 1 year ago

Any plans of using zram disks (with compression) instead of just tmpfs? I use zram-generator to create a compressed disk for the cache of browsers.

graysky2 commented 1 year ago

Never considered it as I am unfamiliar with zram

eduardoeae commented 1 year ago

Made a quick little hack to test this out: sed 's|VOLATILE="\$XDG_RUNTIME_DIR/psd"|VOLATILE="/tmp-compressed/psd"|' -i common/profile-sync-daemon.in Where /tmp-compressed is a zram drive created with zram-generator. By default it is an ext2 fs with lz4 compression. No problem so far and it uses ~40% less memory.

sfatula commented 1 year ago

I would love this, esp helpful on constrained systems. Perhaps it's just really a request to add a psd.conf option for where to put the cachedir? In my case it would simply be /zram/psd instead of /run/user/1000/psd. Not sure there is any need to know much about zram. Could be useful for other cases as well.

stereomato commented 12 months ago

this being configurable (allowing to choose fs and compression algo) would be great

smac89 commented 10 months ago

I think managing zram would be out of the scope of this project. I propose that rather than offering zram specifically, just allow people to choose an alternate sync location. This means they are responsible for creating the zram devices and choosing where it is located

smac89 commented 10 months ago

@eduardoeae how does the speed compare to the current use of tmpfs? Any noticeable difference?

eduardoeae commented 10 months ago

No noticeable difference in performance, only lower memory usage. I'm using it with the default lz4 compressor. I also use a zram compressed drive for $HOME/.cache, /tmpx (mainly used for compiling) and the swap. I even use this in a 2010 laptop with chromium without any problem.