With 300 people online at your peak time, there is no reason to start nginx or php-fpm with that many connections, there is no way you will use them, they are also going to use resources better spent in other places.
Start them off with their default connection limits in place, consider raising them if your traffic increases.
You should adjust these values based on your sites traffic & content, NOT by what others are using, these values should reflect your needs.
Basic optimized configuration:
Code:
client_header_timeout 10m;
client_body_timeout 10m;
send_timeout 10m;
client_max_body_size 10m;
client_body_buffer_size 10m;
connection_pool_size 256;
client_header_buffer_size 8k;
large_client_header_buffers 4 32k;
request_pool_size 8k;
gzip on;
gzip_min_length 1100;
gzip_buffers 8 16k;
gzip_comp_level 1;
gzip_types text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;
gzip_disable "MSIE [1-6]\.";
output_buffers 1 32k;
postpone_output 1460;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
server_names_hash_max_size 4096;
server_names_hash_bucket_size 128;
keepalive_timeout 75 20;
ignore_invalid_headers on;
fastcgi_connect_timeout 60;
fastcgi_send_timeout 180;
fastcgi_read_timeout 180;
fastcgi_buffer_size 8k;
fastcgi_buffers 4 128k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
fastcgi_intercept_errors on;
index index.php;
proxy_buffering on;
proxy_buffer_size 4k;
proxy_buffers 8 32k;
The above is for a site pumping a lot of content, with a lot of ads, with multiple sites hosted, in the header etc, again base these settings off your site.
With 2500 online:
Code:
nginx.conf
worker_processes 8; <-- 1 per core
worker_rlimit_nofile 4096;
events {
worker_connections 1024;
use epoll;
}
php-fpm.conf
listen.backlog = -1
pm = dynamic
pm.max_children = 50
pm.start_servers = 15
pm.min_spare_servers = 10
pm.max_spare_servers = 25
pm.max_requests = 500
With 4000 online, different server/forum
Code:
nginx.conf
worker_processes 16; <-- 1 per core
worker_rlimit_nofile 4096;
events {
worker_connections 2048;
use epoll;
}
php-fpm.conf
listen.backlog = -1
pm = dynamic
pm.max_children = 10
pm.start_servers = 35
pm.min_spare_servers = 15
pm.max_spare_servers = 50
pm.max_requests = 1024