nginx performance test

merlin corey merlincorey at dc949.org
Tue Jan 19 00:42:37 MSK 2010


On Mon, Jan 18, 2010 at 1:35 PM, Davide D'Amico
<davide.damico at contactlab.com> wrote:
> Hi,
> 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?
>
> Thanks,
> d.
>
>
>
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://nginx.org/mailman/listinfo/nginx
>

You may use whatever tools you like. I would recommend testing with as
many as possible from external systems, and I like to use siege and
httperf personally.  You're also testing your OS (and your network,
apparently) as well as nginx, so keep in mind you may have to do
further tuning.

That said, I'm not sure exactly what it is you are intending to test
with this setup.  I would also note that NginX is not a forward proxy,
and your configuration at least appears to be acting like one... so I
don't think your "results" whatever they will be will be particularly
useful to anyone but you.

And I always wonder when I see it in configurations... Did you REALLY
have too long of a server_name that you had to change the hash bucket
size? http://nginx.org/en/docs/http/server_names.html#optimization

-- Merlin



More information about the nginx mailing list