Discussion:
[Supervisor-users] Subprocess health checks
Dave Smith
2014-02-15 03:52:30 UTC
Permalink
I am using supervisord to manage a CherryPy web server. Supervisord does a great job of noticing when the web server process dies and restarting it, but I’d like it to be a bit more proactive than that. I’d like supervisord to periodically execute a command that I specify which will determine the health of the process. For example, it could be a simple curl command to see if my web server is responding correctly. If the command returns a non-zero exit status, I’d like supervisord to kill the subprocess and respawn it.

Questions:

1. Does this already exist in some form that I am not seeing?

2. Would this be an appropriate and valuable thing for supervisord to do? (I obviously think it would be)

3. I’m interested in adding this feature. What approach do you recommend I take? Is there already a pattern in supervisord for things like this?

Thanks!

—Dave
Brent Tubbs
2014-02-15 03:54:27 UTC
Permalink
There is an existing package of Supervisor plugins that includes an HTTP
health check. See
https://github.com/Supervisor/superlance/blob/master/docs/index.rst.
Post by Dave Smith
I am using supervisord to manage a CherryPy web server. Supervisord does a
great job of noticing when the web server process dies and restarting it,
but I'd like it to be a bit more proactive than that. I'd like supervisord
to periodically execute a command that I specify which will determine the
health of the process. For example, it could be a simple curl command to
see if my web server is responding correctly. If the command returns a
non-zero exit status, I'd like supervisord to kill the subprocess and
respawn it.
1. Does this already exist in some form that I am not seeing?
2. Would this be an appropriate and valuable thing for supervisord to do?
(I obviously think it would be)
3. I'm interested in adding this feature. What approach do you recommend I
take? Is there already a pattern in supervisord for things like this?
Thanks!
--Dave
_______________________________________________
Supervisor-users mailing list
https://lists.supervisord.org/mailman/listinfo/supervisor-users
Dave Smith
2014-02-15 04:03:35 UTC
Permalink
Thank you very much. That’s exactly what I’m looking for!

—Dave
There is an existing package of Supervisor plugins that includes an HTTP health check. See https://github.com/Supervisor/superlance/blob/master/docs/index.rst.
I am using supervisord to manage a CherryPy web server. Supervisord does a great job of noticing when the web server process dies and restarting it, but I’d like it to be a bit more proactive than that. I’d like supervisord to periodically execute a command that I specify which will determine the health of the process. For example, it could be a simple curl command to see if my web server is responding correctly. If the command returns a non-zero exit status, I’d like supervisord to kill the subprocess and respawn it.
1. Does this already exist in some form that I am not seeing?
2. Would this be an appropriate and valuable thing for supervisord to do? (I obviously think it would be)
3. I’m interested in adding this feature. What approach do you recommend I take? Is there already a pattern in supervisord for things like this?
Thanks!
—Dave
_______________________________________________
Supervisor-users mailing list
https://lists.supervisord.org/mailman/listinfo/supervisor-users
Loading...