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

What about SIGTERM? #67

Closed
hakavlad opened this issue Jul 4, 2018 · 11 comments
Closed

What about SIGTERM? #67

hakavlad opened this issue Jul 4, 2018 · 11 comments

Comments

@hakavlad
Copy link
Contributor

hakavlad commented Jul 4, 2018

2018 will end soon, but the signal is still not supported.

@hakavlad
Copy link
Contributor Author

hakavlad commented Jul 4, 2018

I expect the follow behavior by default: 10% - SIGTERM, 5% - SIGKILL.

Code like this

if mem < sigkill_level:
    send_signal_to_viсtim(9)
elif mem < sigterm_level:
    send_signal_to_victim(15)
else:
    sleep()

@rfjakob
Copy link
Owner

rfjakob commented Jul 4, 2018

Do you know an app that does something useful on SIGTERM?

@hakavlad
Copy link
Contributor Author

hakavlad commented Jul 4, 2018

I didn't understand what you meant. I know that most of apps accept SIGTERM and terminate correctly.

@rfjakob
Copy link
Owner

rfjakob commented Jul 5, 2018

The disadvantage is that SIGTERM can be ignored by apps. What is the advantage?

@rfjakob
Copy link
Owner

rfjakob commented Jul 5, 2018

I guess the idea is that the app does something like "clean up before shutdown". However, how long does that take? Does it need additional memory to do so?

@hakavlad
Copy link
Contributor Author

hakavlad commented Jul 6, 2018

It happens quickly in most cases. Even it will need additional memory, process will killed at 5% (for example). Also, user will can set thresholds like that: 10% for SIGKILL and 0% for SIGTERM for ignore SIGTERM.
SIGTERM used by full-featured OOM preventer and no any problem happens.

@rfjakob
Copy link
Owner

rfjakob commented Jul 6, 2018

The thing is, this is an extra option that the user may have to think about.

earlyoom only uses sigkill and works fine!

@hakavlad
Copy link
Contributor Author

hakavlad commented Jul 6, 2018

extra option that the user may have to think about

Should I stop offer any features more?

@hakavlad
Copy link
Contributor Author

hakavlad commented Jul 6, 2018

extra option that the user may have to think about

I think that users are not idiots.

@rfjakob
Copy link
Owner

rfjakob commented Jul 6, 2018

Should I stop offer any features more?

No, don't stop! I like several of them.

@rfjakob rfjakob added the wontfix label Jul 7, 2018
@rfjakob rfjakob closed this as completed Jul 7, 2018
@rfjakob rfjakob removed the wontfix label Jul 7, 2018
@rfjakob
Copy link
Owner

rfjakob commented Jul 7, 2018

I am going through old tickets, and read this #34 again.

Apparently postgresql does something useful on SIGTERM. I'll think again about this.

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