Apache stops processing requests (mod_wsgi?)

不羁的心 提交于 2019-12-02 15:01:19

问题


At some point my site, running on Apache2 with mod_wsgi just stops processing requests. The connection to server is maintained and client waits for responce, but it never is returned by apache. The server at this time is at 0% CPU, and nothing is processing. I think, apache just sends request to queue and never gets them out of there. When I perform apache2ctl graceful the problem does not resolve. Only after apache2ctl restart.

My site is a 4 instance wsgi application of Pyramid and 2 instances of Zope 3. It is running normaly and does not have speed problems, that I am aware of.

versions: Ubuntu 10.04 apache2 2.2.14-5ubuntu8.9 libapache2-mod-wsgi 2.8-2ubuntu1


回答1:


Sounds like you are using embedded mode to run the multiple applications and you are using third party C extensions that have problems in sub interpreters, resulting in potential deadlock. Else your code is internally deadlocking or blocking on external services and never returning, causing exhaustion of available processes/threads.

For a start, you should look at using daemon mode and delegate each web application to a distinct daemon process group and then forcing each to run in the main interpreter.

See:

http://code.google.com/p/modwsgi/wiki/QuickConfigurationGuide#Delegation_To_Daemon_Process http://code.google.com/p/modwsgi/wiki/ApplicationIssues#Python_Simplified_GIL_State_API

Otherwise use debugging tips described in:

http://code.google.com/p/modwsgi/wiki/DebuggingTechniques

for getting stack traces about what application is doing.



来源:https://stackoverflow.com/questions/10961257/apache-stops-processing-requests-mod-wsgi

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