Configuration for a high traffic page?

heuri nginx-forum at nginx.us
Wed Jun 15 19:03:17 MSD 2011


Good morning,
can give me someone an example or optimize my example configuration for
a high traffic page?
I'm running Nginx on a Intel(R) Xeon(R) CPU X3440 @ 2.53GHz, 8 cores
with 16 GB RAM DDR3.
With Nginx I run FastCGI-PHP5:
location ~ \.php$ {
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME
/var/www/htdocs$fastcgi_script_name;
            include        fastcgi_params;
	   		fastcgi_intercept_errors on;
        }

The site is a small search engine for some products, so the visitor can
make just a request for some keyword. (So no big POST Uploads for files
or so...).
But for Administrators exists an administration area, where they can
upload images etc. so there should be the post limit not limited.

1. What is the optimal configuration for the timeouts and the buffers?

2. Should I move to PHP-fpm?

My nginx.conf:
------------------------------
user www-data;
worker_processes  4;

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

events {
    worker_connections  1024;
}

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

    access_log	off;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    #keepalive_timeout  65;
    tcp_nodelay        on;

    gzip  on;
    gzip_buffers 16 8k;
    gzip_comp_level 9;
	gzip_http_version 1.1;
	gzip_min_length 10;
	gzip_types text/plain text/css image/png image/gif image/jpeg
application/x-javascript text/xml application/xml application/xml+rss
text/javascript image/x-icon;
	gzip_vary on;
	gzip_proxied any;
	gzip_disable "MSIE [1-6]\.";

	## SIZES - What is the optimal configuration?
	#client_body_buffer_size   8k;
	#client_header_buffer_size 1k;
	#client_max_body_size 1M;
	#large_client_header_buffers 2 1k;

	 ## Timeouts - What is here the optimal configuration?
	client_body_timeout   10;
	client_header_timeout 10;
	keepalive_timeout     5 5;
	send_timeout          10;


    include /etc/nginx/conf.d/*.conf;
    include /etc/nginx/sites-enabled/*;
}

Thank you very much!

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




More information about the nginx mailing list