profile-sync-daemon icon indicating copy to clipboard operation
profile-sync-daemon copied to clipboard

Using zram device instead of tmpfs

Open eduardoeae opened this issue 1 year ago • 7 comments

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.

eduardoeae avatar May 21 '23 05:05 eduardoeae

Never considered it as I am unfamiliar with zram

graysky2 avatar May 21 '23 09:05 graysky2

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.

eduardoeae avatar May 25 '23 16:05 eduardoeae

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.

sfatula avatar Jun 27 '23 20:06 sfatula

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

stereomato avatar Oct 10 '23 05:10 stereomato

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 avatar Dec 02 '23 06:12 smac89

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

smac89 avatar Dec 02 '23 06:12 smac89

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.

eduardoeae avatar Dec 03 '23 04:12 eduardoeae