Nginx Static Content Test (Concurrent Connections)

Posted on April 29, 2017 at 7:18 pm

Here I test how many concurrent connections Nginx can handle when serving static content. In this test I benchmark Nginx on port 80 (HTTP) and on port 443 (HTTPS). The static file is a simple .HTML file and this is the Nginx.conf file I used in the test:

user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
worker_rlimit_nofile 150000;
 
events {
    worker_connections 150000;
    multi_accept on;
    use epoll;
}
 
http {
    include /etc/nginx/mime.types;
    default_type application/octet-stream;
    log_format main '$remote_addr - $remote_user [$time_local] "$request" '
                    '$status $body_bytes_sent "$http_referer" '
                    '"$http_user_agent" "$http_x_forwarded_for"';
 
    access_log /var/log/nginx/access.log main;
 
    sendfile on;
    tcp_nopush on;
    tcp_nodelay on; 
    keepalive_timeout 65;
    reset_timedout_connection on;
    types_hash_max_size 2048;
    server_tokens off;
    server_names_hash_bucket_size 256;
    client_body_in_single_buffer on;
    client_max_body_size 8M;
    client_body_buffer_size 128k;
    client_header_buffer_size 32k;
    large_client_header_buffers 8 32k;
    client_body_timeout 180s;
    client_header_timeout 180s;
    send_timeout 180s;
 
    include /etc/nginx/conf.d/*.conf;
}

(HTTP) 5000 Concurrent Connections

(HTTP) 10000 Concurrent Connections

(HTTPS) 5000 Concurrent Connections

(HTTPS) 10000 Concurrent Connections

Updated on May 1, 2017 at 11:12 am

Receive updates via email

Other Posts

Updated Posts