4

When running a bacon (43-byte transparent pixel) load test on Nginx, we have tried several keepalive_requests values (from 10 to 100,000) and the optimal value seems to be 10.

Here are the server HTTP headers of this tiny reply:

   HTTP/1.1 200 OK
   Server: nginx/1.5.6
   Date: Wed, 23 Oct 2013 12:39:45 GMT
   Content-Type: image/gif
   Content-Length: 43
   Last-Modified: Mon, 28 Sep 1970 06:00:00 GMT
   Connection: keep-alive

Nginx is twice slower with keepalive_requests 100000 than with keepalive_requests 10.

Can you help understanding that result? Or tell what we do wrong?

For reference, here is the nginx.conf file.

Gil
  • 307
  • 3
  • 12

2 Answers2

4

Following the comment's suggestion above, I searched the Nginx Forum and the same question titled "Enabling keepalive increases request time" and posted one month ago was left without any answer.

It looks like a bug. Will have to wait for a fix.

HBruijn
  • 77,029
  • 24
  • 135
  • 201
Gil
  • 307
  • 3
  • 12
-3

I meet the same problem. I use multi_accept,but my benchmark tool's -c num lower then nginx's keepalive_request number,and i user -k argument with benchmark tool the same time. so one of nginx worker will accept and handle the request as many as possible.

You can try to disable multi_accept, then the result may be better.

sysadmin1138
  • 133,124
  • 18
  • 176
  • 300
guxin
  • 1