Open kecsap opened 4 years ago
SwapFree: 17093 M, 89.6 %
This is the problem.
Warnings happens if both MemAvailable and SwapFree thresholds are exceeded.
If you set warning_threshold_min_swap = 100 % notifications will be shown if MemAvailable < 20%.
Now it works. This is a really yummy software if you get it working. I hate that I chosen a laptop with 16 GB RAM to avoid running out of RAM and I can still freeze the machine with ease. Kernel OOM is a joke, it is not worth anything for an average user.
I am not against software with minimal documentation, but there were two things why I bang my head to the wall after some time:
It is not intuitive at all to have white spaces as comment sign in the config file while you also use hashmark like "comments" above the commented lines. -> This is important since I did not understand why my custom rules for additional badness adjustment (after white spaces) did not work and I only scratched my head and get frustrated over time.
Without reading the source code, no way to find out this condition:
"If you set warning_threshold_min_swap = 100 % notifications will be shown if MemAvailable < 20%."
You should add some additional comment to the config file to highlight the logic between these conditions since it is quite black box now.
Otherwise you can close this issue.
An additional comment. I don't know how much my use case is unique, but I prefer to kill sacrificable applications (e.g. code editors, chrome instances) on time to avoid any longer freezing. The swap level does not mean too much in my case because the normal RAM gets full suddenly and I don't want to wait for 10-60 minutes to get back my computer. I follow the RAM usage on my panel in KDE, but I still can get unwanted freezes time-to-time. So it can be a quite common use case when people want early intervention with this daemon and having the killing decisions based on purely the actual remaining RAM. Now I have these min_swap options raised to 100 % for all warning/soft/hard thresholds and it works nicely. The RAM trigger levels are 20-15-10 %. Maybe that is the problem of the user in https://github.com/hakavlad/nohang/issues/98, the expectations were earlier kickin.
Thanks for the feedback!
I know the documentation is terrible. https://github.com/hakavlad/nohang#known-problems The problem is being solved slowly: https://github.com/hakavlad/nohang/issues/22 Right now I'm working on improving the documentation, then there will be a release.
I did not understand why my custom rules for additional badness adjustment (after white spaces) did not work
This is described in the second line of the config:
This is nohang config file.
Lines starting with #, tabs and spaces are comments.
Lines starting with @ contain optional parameters.
All values are case sensitive.
Is this not enough?
This is described in the second line of the config:
This is nohang config file. Lines starting with #, tabs and spaces are comments. Lines starting with @ contain optional parameters. All values are case sensitive.
Is this not enough?
It is enough, but 9x % of the users will not read it, including me. When the config file is opened, the numbered list of options is eye-catching and the attention quickly shifts to the individual options inside the file to crunch them. The first lines are missed.
I am not aware of any Linux daemon which uses white space as comment in the config file inside /etc, but I remember config files with white spaces before the options and they are omitted. Average Linux user speaks from inside, I expect what is the de-facto standard for config files on Linux. If you want to stick to your custom format, put some "WARNING !!!" before and after the explanation in the header to catch the attention.
put some "WARNING !!!
https://github.com/hakavlad/nohang/commit/e6f5363df5fdb8325320da52d14f1cc930b37679 Done.
I don't want to wait for 10-60 minutes to get back my computer
PSI can help you. It can allow you to use swap space if swapping is not too aggressive, but the offender will be terminated if swapping will be to aggressive and prolonged (aggressiveness and duration can be adjusted).
Of course, the settings you use with the prohibition of swapping are much more aggressive.
PSI can help you to suppress only pathological swapping, and let you to use swapping if it is not pathological.
I will use PSI once I switch to Ubuntu 20.04 later.
If you add something additional info about the trigger logic to the "4. Warnings and notifications", this issue can be closed.
If you set warning_threshold_min_swap = 100 % notifications will be shown if MemAvailable < 20%.
Thanks, I had installed nohang a while ago and tried getting notifications working and read through the readme a few times too but gave up, and only many months later, today, did I give it another try.
I edited /etc/nohang/nohang-desktop.conf
and set warning_threshold_min_swap = 25 %
to warning_threshold_min_swap = 100 %
then did a systemctl restart nohang-desktop
then went through my browser history (ctrl + h
) and started ctrl
clicking links like crazy, monitored memory with watch "free --human"
until the memory dropped below 20% (warning_threshold_min_mem
) and POW, I got notifications now!!!!
I think it would be good to put this as a troubleshooting step in the notifications section on the README, I can make a PR if you like.
So thank you for this tip!! If you throw a Sponsor link up on the repo I'd be happy to throw in some cash, this project has saved me real time in my life and I really appreciate it!
The warning system only works with local users right? What about a warning system using wall
for remote systems and all users? Otherwise admins have to enable users to be able read dmesg
output, and user actively check the output...
@alexmyczko See post_kill_exe =
config option.
post_kill_exe = wall haha nohang goes brrr
However, this only works for hard threshold.
For soft threshold:
# Note that a command is slower than sending a signal.
# Empty regex matches with any name.
@SOFT_ACTION_RE_NAME /// sh -c "kill -TERM $PID & wall haha nohang goes brrr"
This command will be executed instead of sending SIGTERM.
It might work, you can try. (I didn't check it with wall
)
I set in nohang-desktop.conf:
Warnings enabled:
Restarting the daemon:
Pushing the system below this threshold:
...and nothing happens. No desktop notification or indication in the log. I tried to set warning_exe in the config, but it does not change anything.