Welcome! Log In Create A New Profile

Advanced

How to tune nginx for 800-1200 concurrent connections?

September 19, 2011 10:29AM
Dear all,

I run nginx as stand-alone webserver (not as Apache proxy) on an image gallery website. The server has to handle up to 1,200 concurrent connections on Port 80, the average number throughout the day is around 500-600. During peak times, the server suffers a bit under its load and I wonder whether there is anything that I can do to decrease the load by tuning the nginx config. I should add that Apache went nuts handling the site and therefore nginx is already a great relief to have. The site has just around 3,000 unique visitors but up to 250,000 pageviews per day.

Here are the relevant server specs:
--------------------------------------------
4 cores at 2.1 GHz
1 GB RAM (average free RAM is around 800 MB even during peak times)

Here is my current nginx.conf:
-------------------------------------

user nginx nginx;
worker_processes 8; # default: 2


error_log logs/error.log;

pid logs/nginx.pid;

events {
worker_connections 2048; # default: 1024
}

http {
include mime.types;
default_type application/octet-stream;
client_max_body_size 64M;
sendfile on;
tcp_nopush on;

keepalive_timeout 20; #default: 3

gzip on;
gzip_comp_level 2;
gzip_proxied any;
gzip_types text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;

server_tokens off;

include /etc/nginx/conf.d/*;
}

Here are the fastcgi settings (The gallery is heavily PHP-driven):
------------------------------------------------------------------------------

include fastcgi_params;
fastcgi_intercept_errors on;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
try_files $uri =404;
fastcgi_pass 127.0.0.1:9000;

I would appreciate your comments and suggestions a lot - Thank you very much in advance!

Kind regards
-A
Subject Author Posted

How to tune nginx for 800-1200 concurrent connections?

dullnicker September 19, 2011 10:29AM

Re: How to tune nginx for 800-1200 concurrent connections?

tsaavik September 25, 2011 12:45PM

Re: How to tune nginx for 800-1200 concurrent connections?

Dennis Jacobfeuerborn September 25, 2011 03:22PM

Re: How to tune nginx for 800-1200 concurrent connections?

dullnicker September 26, 2011 05:30AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 72
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready