Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

For some reason nginx is not accepting any new requests whenever a slow request is being handled. A simple test is to have a script with a sleep() and call the script from different browsers/devices.

The first request is accepted then the second waiting and only accepted once the first request is completed. Is there a way around this?

nginx.conf

user                                nobody nobody;
worker_processes                    1;
error_log                           /var/log/nginx-error.log notice;

events {
  worker_connections              1024;
}

http {
  include                         mime.types;
  default_type                    application/octet-stream;

  # General settings
  index                           index.html index.php;
  sendfile                        on;
  server_tokens                   off;
  client_max_body_size            10M;

  # TCP options
  tcp_nodelay                   on;
  tcp_nopush                    on;

  # NginxHttpGzipModule
  gzip                            on;
  gzip_buffers                    16 8k;
  gzip_comp_level                 5;
  gzip_disable                    "MSIE [1-6].(?!.*SV1)";
  gzip_http_version               1.0;
  gzip_min_length                 0;
  gzip_proxied                    any;
  gzip_types                      text/plain text/css text/xml text/javascript application/x-javascript application/xml application/xml+rss;
  gzip_vary                       on;

  include /usr/local/nginx/sites/*.conf;
}
share|improve this question
    
What is your worker connections set to and can you post your nginx config file? –  Chida Aug 13 '12 at 21:13
    
Since I've got only 1 core I've set the worker_processes to 1, updated my post with my config. –  xidew Aug 13 '12 at 21:15
3  
It seems my problem was due to the php-fpm settings pm.*. The reason why the requests were not handled by nginx is because there were no php-fpm process idle to process the request. Technically, nginx accepted the request but was waiting for a free php-fpm process. –  xidew Aug 13 '12 at 21:28

1 Answer 1

up vote 0 down vote accepted

It seems my problem was due to the php-fpm settings pm.*. The reason why the requests were not handled by nginx is because there were no php-fpm process idle to process the request. Technically, nginx accepted the request but was waiting for a free php-fpm process.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.