Way to queue connections until a uwsgi socket available?

kickme444 nginx-forum at nginx.us
Thu Dec 9 01:13:09 MSK 2010


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


 /var/run/nginx-uwsgi/wsgi-app.sock
 /path/to/python/app
 wsgi
 33
 33
 12
 
 60
 256
 10
 10
 
 



Any help here would be GREATLY appreciated!

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,156979,156979#msg-156979




More information about the nginx mailing list