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

Intercept a sigterm to do extra logging? #2383

Closed
rokas3883 opened this issue Jun 10, 2015 · 5 comments
Closed

Intercept a sigterm to do extra logging? #2383

rokas3883 opened this issue Jun 10, 2015 · 5 comments

Comments

@rokas3883
Copy link

To avoid once-in-a-while occurring memory leaks with our sidekiq workers, we've set up monit to restart the worker if its memory footprint exceeds a certain amount.

When the worker gets restarted (with sigterm), I'd like to send an Airbrake, as well as log it in Mongo, so we can see/analyze how often these workers are restarted.

Is there a clean way to do this with sidekiq? I haven't found any in the documentation yet.

@rokas3883 rokas3883 changed the title Is there a way to intercept a SIGTERM, and Intercept a sigterm to do extra logging? Jun 10, 2015
@ryansch
Copy link
Contributor

ryansch commented Jun 10, 2015

Generally you would do the alerting with whatever you're using to restart sidekiq (monit in this case). I use something other than monit and I have it send alerts to our slack channel.

@mperham
Copy link
Collaborator

mperham commented Jun 10, 2015

You should configure monit to do this. There's no way to do it in Sidekiq.

On Jun 9, 2015, at 18:15, Rokas Venckus notifications@github.com wrote:

To avoid once-in-a-while occurring memory leaks with our sidekiq workers, and we've set up monit to restart the worker if it's memory footprint exceeds a certain amount.

When the worker gets restarted (with sigterm), I'd like to send an Airbrake, as well as log it in Mongo, so we can see/analyze how often these workers are restarted.

Is there a clean way to do this with sidekiq? I haven't found any in the documentation yet.


Reply to this email directly or view it on GitHub.

@rokas3883
Copy link
Author

Thanks for the responses. I'll look into monit doing the alerts.

@VishalRam
Copy link

@ryansch - What kind of service do you use for alerting? Can you I know some other options?

@ryansch
Copy link
Contributor

ryansch commented Oct 8, 2015

There are a number of good choices for monitoring processes. I happen to know the guy who maintains https://github.com/mperham/inspeqtor

😉

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

4 participants