benoitc / gunicorn

gunicorn 'Green Unicorn' is a WSGI HTTP Server for UNIX, fast clients and sleepy applications.
http://www.gunicorn.org
Other
9.76k stars 1.74k forks source link

Should sync workers have an optional kill-on-timeout feature? #173

Closed mw44118 closed 13 years ago

mw44118 commented 13 years ago

I use sync workers because I expect that my app replies quickly. But as a safeguard, what do you think about adding some kind of optional timeout feature?

The idea would be that if a worker takes too long to handle a request, we send a kill -HUP to that worker. Maybe to make it more simple, we just call a callback (if defined) and then that callback can do what it wants.

For example, it might just log the problem, or it might kill the worker.

Thoughts?

benoitc commented 13 years ago

This feature is already handled. Default timeout is 30 seconds. If after this timeout the worker didn't notify the arbiter he is still alived, the worker is killed. Timeout can be changed via the command line or configuration file.

mw44118 commented 13 years ago

Awesome. The more I study gunicorn, the more I like it. Thanks for the quick reply!