Forum: NGINX ngin goes down under high traffic

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
6d488413c312bdf68d69f121b8eb4e29?d=identicon&s=25 David Pospisil (Guest)
on 2008-11-16 21:15
(Received via mailing list)
Please look at http://pub.horror.superhosting.cz/data/eth0-6h.png.
Everytime nginx goes under high traffic, it stops offering files and
instead of
this, it starts reading of discs (it reads about 400Mb/s but send
nothing). I
have to restart nginx then.
Linux Debian etch 2.6.24, nginx 0.6.32,
nginx.conf:
user www-data;
worker_processes  64;

error_log  /var/log/nginx/error.log debug;
pid        /var/run/nginx.pid;

events {
    worker_connections  2048;
}

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

    access_log  /var/log/nginx/access.log;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;
    tcp_nodelay        on;

    gzip  on;

    include /etc/nginx/sites-enabled/*;

}

# You may add here your
# server {
#       ...
# }
# statements for each of your virtual hosts

server {
        listen   xx.89.xx.xx:80;
        server_name  free.xx.com;

        access_log  "/home/logs/free/nginx_access.log";
  error_log   "/home/logs/free/nginx_error.log" info;

        location / {
                root   "/home/www/xx.com/free";
                index  index.html index.htm;
    rewrite "^/(.*)" "/index.php?cgi_download_uri=$1" last;
  }

  location /storage/ {
       internal;
      alias /storage/;
  }

        #error_page  404  /404.html;

        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
                root   /var/www/nginx-default;
        }

        # proxy the PHP scripts to Apache listening on 127.0.0.1:80
        #
        location ~ \.php$ {
           proxy_pass   http://127.0.0.1;
     proxy_set_header  X-Real-IP  $remote_addr;
           proxy_set_header  Host  $host;
                 proxy_set_header  X-Forwarded-For
$proxy_add_x_forwarded_for;
     proxy_buffering off;
        }

        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        #location ~ /\.ht {
                #deny  all;
        #}
}

Thank you for any suggestion.
Fda08117336cfde6562315df04b976e8?d=identicon&s=25 Dave Cheney (Guest)
on 2008-11-16 22:26
(Received via mailing list)
Try reducing the number of workers you have. Nginx is not like apache,
you don't need one worker per active connection. I would suggest no
more than 1 or 2 workers per spindle max.

Cheers

Dave
2d414b53b31339e844e12209201ed123?d=identicon&s=25 Sasa Ugrenovic (Guest)
on 2008-11-17 08:40
(Received via mailing list)
You sure its nginx, maybe php ?
Anything in logs ? Tryed strace on working nginx processes (when it
starts reading off the disc) to see what's happening ?

I think more info is needed. What type of content your delivering, disc
configuration, etc.

--

On Sun, 16 Nov 2008 18:19:17 +0000 (UTC)
26390d2cd9d9ec8750064814ccffba97?d=identicon&s=25 Sebastian Geib (Guest)
on 2008-11-17 12:33
(Received via mailing list)
Hi David,

David Pospisil schrieb:
> Please look at http://pub.horror.superhosting.cz/data/eth0-6h.png.
> Everytime nginx goes under high traffic, it stops offering files and instead of
> this, it starts reading of discs (it reads about 400Mb/s but send nothing). I
> have to restart nginx then.
> Linux Debian etch 2.6.24, nginx 0.6.32,
>
> [...]
>
> Thank you for any suggestion.
It might be something pretty basic. I just had it in a similar
constellation with a database server. Did you test whether your network
interface supports more than the maximum throughput your graph is
showing? I realized that GBit interfaces are sometimes already maxed out
at 300-400 MBit and when I added additional interfaces and created a
bonding interface the load went away and everything was working fine
again.

Just a thought.

Sebastian

--
Sebastian Geib

Chabango IT Services
Zillestra├če 74/76
10585 Berlin

Fon: +49 (0) 30 327 67 98-0
Fax: +49 (0) 30 327 67 98-5

E-Mail: sebastian.geib@chabango.com
This topic is locked and can not be replied to.