We are currently configuring nginx and uwsgi on ubuntu 9.10. We are having a problem while load testing in that when uwsgi becomes saturated, nginx kills incoming connections rather than queueing. I cannot figure out if there is a way to do this queueing in nginx. The errors we get in the nginx error log look like:
2010/12/08 12:57:03 [error] 15276#0: *10079 connect() to unix:///var/run/nginx-uwsgi/wsgi-app.sock failed (11: Resource temporarily unavailable) while connecting to upstream, client: xx.xxx.xx.xx, server: www.app.com, request: "GET /url/here/ HTTP/1.1", upstream: "uwsgi://unix:///var/run/nginx-uwsgi/wsgi-app.sock:", host: "ec2-xxx-xxx-xxx-xx.compute-1.amazonaws.com"
I have tried kqueue and poll to no avail.
Here is our nginx.conf
--------------
user www-data;
worker_processes 2;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
access_log /var/log/nginx/access.log;
sendfile on;
keepalive_timeout 65;
tcp_nodelay on;
gzip on;
gzip_disable "MSIE [1-6]\.(?!.*SV1)";
client_max_body_size 50m;
server {
listen 80;
server_name app;
access_log /var/log/nginx/access_80.log;
location / {
uwsgi_connect_timeout 10;
uwsgi_pass unix:///var/run/nginx-uwsgi/wsgi-app.sock;
include uwsgi_params;
}
}
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
here is our uwsgi.xml file
<uwsgi>
<socket>/var/run/nginx-uwsgi/wsgi-app.sock</socket>
<pythonpath>/path/to/python/app</pythonpath>
<module>wsgi</module>
<uid>33</uid>
<gid>33</gid>
<processes>12</processes>
<master/>
<harakiri>60</harakiri>
<limit-as>256</limit-as>
<socket-timeout>10</socket-timeout>
<sharedarea>10</sharedarea>
<memory-report/>
<chmod-socket/>
</uwsgi>
Any help here would be GREATLY appreciated!