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

Notify-send slowdown #73

Closed
hakavlad opened this issue Jul 6, 2018 · 14 comments
Closed

Notify-send slowdown #73

hakavlad opened this issue Jul 6, 2018 · 14 comments

Comments

@hakavlad
Copy link
Contributor

hakavlad commented Jul 6, 2018

...if & not in the end of the command.

Replace
"-i dialog-warning 'earlyoom' 'Killing process %d %s'", victim_pid, victim_name);
with
"-i dialog-warning 'earlyoom' 'Killing process %d %s' &", victim_pid, victim_name);
will fix the problem

@hakavlad
Copy link
Contributor Author

hakavlad commented Jul 6, 2018

Earlyoom slowdowns until notify-send runs. Adding '&' fixes problem.

@rfjakob
Copy link
Owner

rfjakob commented Jul 6, 2018

I see. But we also have to stop sending notifications until the first one is finished.

@rfjakob
Copy link
Owner

rfjakob commented Jul 6, 2018

Otherwise we may spawn too many processes, and slow the system down even worse.

@hakavlad
Copy link
Contributor Author

hakavlad commented Jul 6, 2018

spawn too many processes, and slow the system down even worse

Have you seen this in fact even once?

@hakavlad
Copy link
Contributor Author

hakavlad commented Jul 6, 2018

Slowdown the system will stop after 1st SIGKILL.

@rfjakob
Copy link
Owner

rfjakob commented Jul 6, 2018

Yes i have seen this with cronjobs that pile up. The server then enters a death spiral

rfjakob added a commit that referenced this issue Jul 6, 2018
Send the GUI notification AFTER killing a process. This makes it more likely
that there is enough memory to spawn the notification helper.

#73
@rfjakob
Copy link
Owner

rfjakob commented Jul 6, 2018

earlyoom was sending the notification first, and kills later. As sending the notification needs memory, this was stupid. The change b2fe57c kills first, and notifies later. Does this fix the slowdown you see?

@hakavlad
Copy link
Contributor Author

hakavlad commented Jul 6, 2018

I need test it, I try it later.

@rfjakob
Copy link
Owner

rfjakob commented Jul 6, 2018

PS: c91dc9e

@hakavlad
Copy link
Contributor Author

hakavlad commented Jul 6, 2018

Thank you very much

@hakavlad
Copy link
Contributor Author

hakavlad commented Jul 6, 2018

kills first, and notifies later. Does this fix the slowdown you see?

Works great, thanks!

@rfjakob
Copy link
Owner

rfjakob commented Jul 7, 2018

Thanks for testing!

@rfjakob rfjakob closed this as completed Jul 7, 2018
@hakavlad
Copy link
Contributor Author

hakavlad commented Dec 4, 2018

@rfjakob

Otherwise we may spawn too many processes, and slow the system down even worse.

I ran even

while true; do (notify-send lol &); done

and nothing happened.
Notify-send is very short-life process, it just quickly send info to notification daemon and die.
That's why using Popen and & seems like not dangerous.

@rfjakob
Copy link
Owner

rfjakob commented Dec 5, 2018

That contradicts what you saw in #73 (comment) , right?

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

2 participants