graysky2 / profile-sync-daemon

Symlinks and syncs browser profile dirs to RAM thus reducing HDD/SDD calls and speeding-up browsers.

Home Page:https://wiki.archlinux.org/index.php/Profile-sync-daemon

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Using zram device instead of tmpfs

eduardoeae opened this issue · 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.

Never considered it as I am unfamiliar with zram

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.

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.

commented

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

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

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

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.