我不得不重新启动uwsgi进程

我正在使用uwsginginx的组合来服务我的烧瓶应用程序。 发生什么事是几个小时后(在非常低的负载下,<几百个请求),请求超时,直到我重新启动uwsgi进程,事情再次工作相同的时间。

这里是nginx的conf:

server { listen 3001; server_name localhost; charset utf-8; client_max_body_size 75M; location / { try_files $uri @myapp; } location @myapp { include uwsgi_params; uwsgi_pass unix:/my/dir/uwsgi.sock; } } 

我的uwsgi.ini:

 [uwsgi] #application's base folder base = /my/dir #python module to import app = app module = %(app) home = %(base)/venv pythonpath = %(base) #socket file's location socket = /my/dir/%n.sock #permissions for the socket file chmod-socket = 666 #the variable that holds a flask application inside the module imported at line #6 callable = app #location of log files logto = /my/dir/log/%n.log ~ 

我如何启动uwsgi进程:

 /my/dir/venv/bin/uwsgi --ini /my/dir/uwsgi.ini 

有几十种方法可以挂起你的栈(特别是没有并发的configuration)。

我build议你调查为什么而不是绕过它(像harakirifunction)。 启用uWSGI追溯程序来了解当应用卡住时发生了什么事情:

http://uwsgi-docs.readthedocs.org/en/latest/Tracebacker.html