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

Configuration for systems using ZRAM and/or SSD swap #27

Open
hakavlad opened this issue Mar 17, 2019 · 6 comments
Open

Configuration for systems using ZRAM and/or SSD swap #27

hakavlad opened this issue Mar 17, 2019 · 6 comments

Comments

@hakavlad
Copy link

hakavlad commented Mar 17, 2019

The default settings are bad for me: TP often stops multiple processes. How do I configure TP?
How to limit the number of stopped processes? How to change the threshold at which TP starts to stop the processes? How to make TP less sensitive? (Perhaps the fact is that I use ZRAM and have a fast swap.)

@tobixen
Copy link
Owner

tobixen commented Mar 17, 2019

Currently some of the configuration can be tuned through environment variables. Check the code.

Eventually I should implement support for argparse and config file.

@hakavlad
Copy link
Author

OK, thanks.

@afontenot
Copy link

Hey @hakavlad do you still use thrash-protect? I'm wondering if you managed to find any better settings. I'm in a very similar situation: I use ZRAM and have fast (SSD) swap, and every minute or two I'm getting multi-second hangs even though I have 3-4 GB of memory free. Not sure if I should just give up on thrash-protect or not.

@tobixen
Copy link
Owner

tobixen commented Jan 16, 2020

Perhaps thrash-protect simply doesn't make sense on systems with swap on SSD. Thrashing situations should not be that bad when the swap storage isn't orders of magnitudes slower than the memory. (Well, rumors had it early SSDs would simply wear out if there were too many write operations - if that's true, then thrash-protect may be important anyway).

That said, it's a bug if you really have gigabytes of memory free and you experience the whole system is frozen up for several seconds. What version do you use? What does the log say?

@tobixen
Copy link
Owner

tobixen commented Jan 16, 2020

I don't have any experience with ZRAM. I read on Wikipedia that one common usage pattern is to set up compressed memory space as a swap device. Perhaps unused space on that swap device will show up as free memory on your system, but yet the amount of swapping may be much higher than on a normal system.

If you want to try tuning, then the environment variable THRASH_PROTECT_INTERVAL (default 0.5 - amount is in seconds) should be tuned down, and 'THRASH_PROTECT_SWAP_PAGE_THRESHOLD (default 4) should be tuned up.

If I've understood it right, swapping in such a scenario actually means compressing/decompressing of the memory going in/out of "swap", so it will cause CPU load but not a lot of IO. One may end up with the machine being "thrashed out" with every context switch causing a lot of CPU load.

@tobixen tobixen reopened this Jan 16, 2020
@tobixen tobixen changed the title Configuration Configuration for systems using ZRAM and/or SSD swap Jan 16, 2020
@tobixen
Copy link
Owner

tobixen commented Jan 16, 2020

Reopening the ticket. Proper research should be done to see if thrash-protect can be tuned to actually be useful on such systems, or if it's not useful at all. This should also be documented in the README.

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

3 participants