nginx performance test

Davide D'Amico davide.damico at
Tue Jan 19 00:35:03 MSK 2010

I've a Dell R410 with dual Xeon E5530 with 8gb ddr so I would like to test/discover nginx perfomances.

Here my config file /usr/local/etc/nginx/nginx.conf:
orker_processes  10;

events {
    accept_mutex off;
    worker_connections  8192;
    use kqueue;

http {
    server_names_hash_bucket_size 64;

    include             /usr/local/etc/nginx/mime.types;
    default_type        application/octet-stream;

    log_format upstream '$remote_addr - $host - [$time_local] '
                    '"$request" $status $body_bytes_sent "$http_referer" '
                    '"$http_user_agent" "$http_x_forwarded_for" [$upstream_addr]';

    access_log          /var/log/nginx/nginx-access.log;
    error_log           /var/log/nginx-error.log;

    # spool uploads to disk instead of clobbering downstream servers
    client_body_temp_path /var/spool/nginx-client-body 1 2;
    client_max_body_size 32m;
    client_body_buffer_size    2048k;

    sendfile            on;
    tcp_nopush          on;
    tcp_nodelay         off;

    keepalive_timeout   1;

    # proxy settings
    proxy_redirect     off;

    proxy_set_header   Host             $host;
    proxy_set_header   X-Real-IP        $remote_addr;
    proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
    proxy_max_temp_file_size 0;

    proxy_connect_timeout      300;
    proxy_send_timeout         300;
    proxy_read_timeout         300;

    proxy_buffer_size          32k;
    proxy_buffers              4 64k;
    proxy_busy_buffers_size    64k;
    proxy_temp_file_write_size 64k;
    include             /usr/local/etc/nginx/upstream.conf;
    include             /usr/local/etc/nginx/sites/*.conf;

And a vhost is defined:

proxy_cache_path /usr/local/www/xxx/cache levels=1:2 keys_zone=XXX:10m inactive=24h max_size=1g;

server {
  ssl on;
  ssl_certificate      /usr/local/etc/nginx/certs/xxx.pem;
  ssl_certificate_key  /usr/local/etc/nginx/certs/xxx.key;
  keepalive_timeout    70;

  listen kkk.kkk.kkk.kkk:443;
  server_name xxx.*;
  proxy_redirect     off;
  proxy_set_header   Host             $host;
  proxy_set_header   X-Real-IP        $remote_addr;
  proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
  proxy_store_access   user:rw  group:rw  all:r;

  proxy_connect_timeout      1200;
  proxy_send_timeout         1200;
  proxy_read_timeout         1200;

  access_log          /var/log/nginx/xxx-access.log upstream;
  error_log           /var/log/nginx/xxx-error.log;

  error_page   500 502 503 504  /50x.html;
  location = /50x.html {
    root   /usr/local/www/nginx-dist;

  location ~ \.(gif|jpg|png)$ {
    proxy_pass http://zzz.zzz.zzz.zzz:80;
    proxy_cache XXX;
    proxy_cache_valid 200 1d;
    proxy_cache_use_stale error timeout invalid_header updating http_500 http_502 http_503 http_504;

  location / {
    proxy_pass http://zzz.zzz.zzz.zzz:80;

May I use httperf? jmeter? Using the config file I could estimate how many static pages could I serve per period?
Other statistics?


More information about the nginx mailing list