Httperf results with nginx and apache

I am attempting to do a bit of a comparison between nginx and apache
using httperf but my results are coming out a little strange. I am
running the following against both apache and nginx:

httperf --timeout=5 --client=0/1 --server=DOMAIN --port=80
–uri=/robots.txt --rate=200 --send-buffer=4096 --recv-buffer=16384
–num-conns=5000 --num-calls=10

The results I am seeing are the following:

NGINX:

Total: connections 5000 requests 50000 replies 50000 test-duration 25.001 s Connection rate: 200.0 conn/s (5.0 ms/conn, <=5 concurrent connections) Request rate: 2000.0 req/s (0.5 ms/req)

Apache:

Total: connections 5000 requests 10000 replies 5000 test-duration 24.998 s Connection rate: 200.0 conn/s (5.0 ms/conn, <=1 concurrent connections) Request rate: 400.0 req/s (2.5 ms/req)

Shouldn’t the ‘Total’ numbers be the same against both web servers since
I am using the same command to test them? Why is the ‘requests’ number a
1/5 of number that nginx responds with. Has anyone see this sort of
result in the past?

I have attempted this with a few different connection, rate and call
counts and seem to get similar results with each.

I have verified that my MaxClients and Servers setting in Apache is high
enough as well.

Thanks.
-Joe

On Wed, Feb 27, 2008 at 05:20:08PM -0600, Joe W. wrote:

NGINX:

1/5 of number that nginx responds with. Has anyone see this sort of
result in the past?

I have attempted this with a few different connection, rate and call
counts and seem to get similar results with each.

I have verified that my MaxClients and Servers setting in Apache is high
enough as well.

The difference is probably in keepalive settings.
Look --num-conns=5000 and --num-calls=10 parameters.

Keepalives did the trick, thanks for the advice!

Are keepalives on by default in Nginx?

-Joe

On Thu, Feb 28, 2008 at 10:29:55AM -0600, Joe W. wrote:

Keepalives did the trick, thanks for the advice!

Are keepalives on by default in Nginx?

Yes. Keepalives are cheap for nginx, however, they take sockets, file
descriptors, etc. in kernel.

Understood, thanks for the help.

-Joe