Nginx hidden performance option
April 21, 2009
I am not exactly sure why this isn’t documented but nginx as of 0.7.x supports event ports
This is a huge performance win for Solaris. Nginx can avoid the 0(n) file descriptor problem with event ports support.
To enable event ports add this to your nginx.conf
events {
use eventport;
}
Here is our performance-proven configuration that we use on fabulously40
The follow configuration will help you survive massive traffic with nginx. We have served 4.4 million requests in a 4 hour time frame with no issues. That is 305req/sec.
worker_processes 8;
worker_rlimit_nofile 10240;
events {
worker_connections 8024;
use eventport;
}
http {
keepalive_timeout 20;
server_names_hash_bucket_size 64;
sendfile on;
tcp_nopush on;
client_max_body_size 150m;
gzip on;
gzip_comp_level 5;
gzip_vary on;
gzip_proxied any;
gzip_types text text/plain text/css text/xml application/xml text/javascript text/html application/x-javascript;
}
Nice for sharing this.
Thanks for this. My Nginx site went from
Requests per second: 2539.71 [#/sec] (mean)
to
Requests per second: 3747.65 [#/sec] (mean)
It *is* documented, although it’s admittedly not something that jumps out at you:
http://wiki.nginx.org/NginxHttpEventsModule#use
http://wiki.nginx.org/NginxOptimizations
I would not use it since nginx would stop accepting connections after some time.