mod_wsgi process getting killed and django stops working

青春壹個敷衍的年華 提交于 2019-12-04 07:09:50

For a start, read:

http://blog.dscpl.com.au/2009/11/save-on-memory-with-modwsgi-30.html

and disable initialisation of Python interpreter within embedded processes if only using daemon mode. Those log messages are likely from embedded processes and showing up because of overly aggressive settings for Apache MPM that cause main Apache child processes to be started up and shutdown to much. Disable the unused interpreters and likely those messages will go away.

This issue though is separate to your problem with the daemon mode process.

For that, set on WSGIDaemonProcess the 'display-name=%{GROUP}' option. This will cause daemon mode process to show as '(wsgi:django)' in 'ps' output listing. That way you can clearly identify which process it is.

Then when your process killer kicks in use 'ps' to verify the state of the process and whether there is actually one and whether it shutdown properly. What may be happening is that process is refusing to shutdown because it is hanging on waiting for some child process to shutdown or stuck on some remote file system operation. Alternatively, the code is registering a signal handler which is interfering with correct shutdown.

If that process doesn't shutdown properly it will not be replaced, yet the initiation of a shutdown may put it in to a state where by it doesn't accept new requests either.

So, start with that and report back what you find.

BTW, there is an official mod_wsgi mailing list. StackOverflow is a poor medium for back and forth debugging of problems like this.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!