Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dump Django stack trace on Gunicorn timeout

I'm trying to debug rare hangs of a Django application. So far I failed to isolate the problem, it happens about once a day in production and Gunicorn restarts the process with a message:

[CRITICAL] WORKER TIMEOUT

Is there a way to configure Django or Gunicorn to dump a stack trace of a process that is restarted?

like image 779
Jan Wrobel Avatar asked Mar 15 '13 21:03

Jan Wrobel


1 Answers

Try setting your Gunicorn log to be more verbose, maybe set it to INFO or DEBUG that might shed more light in the log.

You could also take a look at Dog Slow, which will log slow requests. https://pypi.python.org/pypi/dogslow.

And for general logging win, try using Sentry: https://www.getsentry.com/welcome/.

Random question, any crons on the server running at that time, backups, that sorta thing?

like image 57
krak3n Avatar answered Nov 15 '22 07:11

krak3n