Performance choking around 400 req/sec ???

Cabbar Duzayak cabbar at gmail.com
Thu Apr 12 11:43:51 UTC 2012


Hi everyone,

I should start by saying I am a newbie and have recently started using
NGINX and VERYY happy with it. But, I have been trying to run some
stress tests on NGINX (hitting a static file), and it looks like no
matter what I do, server is choking at around 400 req/sec. Isn't this
too low for a static file on NGINX? Am I doing something wrong?

I have increased hard/soft limit to 30K/10K. My machine is reasonably
powerful (quad-core i7 with 8gb RAM) and during the tests, CPU load is
pretty low.

I used apache bench to do performance testing and I am hitting a
static file on local filesystem. I ran the test from 2 different
machines (nginx is on the 3rd machine) and used the following command
on each starting at the same time:

ab -n 10000 -c 400 http://mydomain.com/static.html

Results of one of these is below:

Document Length:        29638 bytes

Concurrency Level:      400
Time taken for tests:   33.856 seconds
Complete requests:      10000
Failed requests:        0
Write errors:           0
Total transferred:      300038664 bytes
HTML transferred:       297222704 bytes
Requests per second:    295.37 [#/sec] (mean)
Time per request:       1354.241 [ms] (mean)
Time per request:       3.386 [ms] (mean, across all concurrent requests)
Transfer rate:          8654.48 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        6  448 1276.7    113   21113
Processing:   120  840 621.7    570    5980
Waiting:        5  186 176.3    114    2200
Total:        132 1288 1420.9    695   23143

Percentage of the requests served within a certain time (ms)
  50%    695
  66%   1134
  75%   1474
  80%   1721
  90%   3027
  95%   3685
  98%   4688
  99%   6445
 100%  23143 (longest request)


Am I missing something here??? Relevant parts of NGINX Conf:

worker_processes 6;
worker_rlimit_nofile 30000;

events {
        worker_connections 1024;
        # multi_accept on;
}

http {

        sendfile on;
        tcp_nopush on;
        tcp_nodelay on;
        keepalive_timeout 65;
        types_hash_max_size 2048;
        # server_tokens off;

        # server_names_hash_bucket_size 64;
        # server_name_in_redirect off;

        log_format combined_perf '$remote_addr - $remote_user [$time_local]  '
                                 '"$request" $status $body_bytes_sent '
                                 '"$http_referer" "$http_user_agent" '
                                 '[$request_time / $upstream_response_time]';

        access_log /var/log/nginx/root/access.log combined_perf;
        error_log /var/log/nginx/root/error.log error;

        ##
        # Gzip Settings
        ##

        gzip on;
        gzip_disable "msie6";
……
}

Thanks a ton!



More information about the nginx mailing list