Forum: NGINX nginx high load average

Posted by iLinux85 (Guest)
on 2013-01-29 23:09
(Received via mailing list)
hello

i have server running as shared server Intel(R) Xeon(R) CPU E3-1225 V2 @
3.20GHz 4 core and 16 g.b ram running onCentOS release 5.9 (Final) 
upload
and download via php scripts like rapidshare

the problem is i have high connections on this server and i want to know 
how
could i configure the nginx correctly

here is my current nginx.conf


user  nobody;
# no need for more workers in the proxy mode
worker_processes  1;

error_log  logs/error.log info;

worker_rlimit_nofile  8192;

events {
 worker_connections  51200; # you might need to increase this setting 
for
busy servers
 use epoll; #  Linux kernels 2.4.x  change to rtsig
}

http {
 server_names_hash_max_size 2048;

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

 sendfile on;
 tcp_nopush on;
 tcp_nodelay on;

 keepalive_timeout  10;

 gzip on;
 gzip_min_length  1100;
 gzip_buffers  4 32k;
 gzip_types    text/plain application/x-javascript text/xml text/css;
 ignore_invalid_headers on;

 client_header_timeout  3m;
 client_body_timeout 3m;
 send_timeout     3m;
 connection_pool_size  1024;
 client_header_buffer_size 4k;
 large_client_header_buffers 4 32k;
 request_pool_size  4k;
 output_buffers   4 32k;
 postpone_output  1460;
 proxy_temp_path      /home/proxy_temp;
 include "/usr/local/nginx/conf/vhost.conf";
}

Posted at Nginx Forum: 
http://forum.nginx.org/read.php?2,235709,235709#msg-235709
Posted by Liu Lantao (Guest)
on 2013-01-30 03:51
(Received via mailing list)
'worker_processes' should be equal to  total numbers of CPU cores.

What does 'high connections' mean?

Please show the result of 'cat /proc/net/sockstat', and the content of '
/usr/local/nginx/conf/vhost.conf'.
Posted by Steve Holdoway (Guest)
on 2013-01-30 07:10
Attachment: smime.p7s (6,04 KB)
(Received via mailing list)
It's very unlikely that nginx is causing a high load average. If I
separate it off from the php/database processing, I can run it on a low
power, single threaded vps with 128MB memory.

What process is really using your CPU?

Steve
Posted by iLinux85 (Guest)
on 2013-01-30 18:44
(Received via mailing list)
this is a shared server like any other shared sites support download and
upload files like movies and programs , stuff over 1 and 2 gigabyte for
download and upload , i am trying to adjust the connections in the 
server to
work good with nginx , and this is my vhost.conf

high connection mean alot of visitors established connection in my 
server

      4 TIME_WAIT
      9 SYN_RECV
      2 LISTEN
     40 LAST_ACK
    988 ESTABLISHED

and this is vhost.conf


   server {

  access_log off;

  error_log  logs/vhost-error_log warn;
  listen    80;
  server_name  site.com www.site.com;

  # uncomment location below to make nginx serve static files instead of
Apache
  # NOTE this will cause issues with bandwidth accounting as files wont 
be
logged
  location
~.*\.(3gp|gif|jpg|jpeg|png|ico|wmv|avi|asf|asx|mpg|mpeg|mp4|pls|mp3|mid|wav|swf|flv|html|htm|txt|js|css|exe|zip|tar|rar|gz|tgz|bz2|uha|7z|doc|docx|xls|xlsx|pdf|iso)$
{
  root   /home3/s9/public_html;
  }

  location / {
   proxy_send_timeout   90;
   proxy_read_timeout   90;

   proxy_buffer_size    4k;
   # you can increase proxy_buffers here to suppress "an upstream 
response
   #  is buffered to a temporary file" warning
   proxy_buffers     16 32k;
   proxy_busy_buffers_size 64k;
   proxy_temp_file_write_size 64k;

   proxy_connect_timeout 30s;

   proxy_redirect  http://www.site.com:81   http://www.site.com;
   proxy_redirect  http://site.com:81   http://site.com;

   proxy_pass   http://192.168.0.1:81/;

   proxy_set_header   Host   $host;
   proxy_set_header   X-Real-IP  $remote_addr;
   proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;

            # track uploads in the 'proxied' zone
            # remember connections for 30s after they finished
            track_uploads proxied 30s;
  }
        location ^~ /progress {
            # report uploads tracked in the 'proxied' zone
            report_uploads proxied;
        }
 }

Posted at Nginx Forum: 
http://forum.nginx.org/read.php?2,235709,235745#msg-235745
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.