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

Using zram device instead of tmpfs #357

Open
eduardoeae opened this issue May 21, 2023 · 7 comments
Open

Using zram device instead of tmpfs #357

eduardoeae opened this issue May 21, 2023 · 7 comments

Comments

@eduardoeae
Copy link

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
Copy link
Owner

Never considered it as I am unfamiliar with zram

@eduardoeae
Copy link
Author

eduardoeae commented May 25, 2023

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
Copy link

sfatula commented Jun 27, 2023

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
Copy link

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

@smac89
Copy link
Contributor

smac89 commented Dec 2, 2023

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
Copy link
Contributor

smac89 commented Dec 2, 2023

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

@eduardoeae
Copy link
Author

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.

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

No branches or pull requests

5 participants