nginx vs apache as a reverse proxy

Linden Varley Linden.Varley at
Tue Mar 3 06:16:40 MSK 2009

Sorry I should of mentioned that the requests per second are also slightly higher with apache over nginx. Although it’s a marginal amount it is consistent.

Yes the backend server has a large number of sockets in TIME_WAIT and yes keep-alive is on on the backend too. Turning it off does actually close the gap which is much better, but are there any plans for the proxying in nginx to support keep-alives?

It plays havoc with the firewall too since it creates a new state entry in the state table for each socket.

-----Original Message-----
From: owner-nginx at [mailto:owner-nginx at] On Behalf Of Cliff Wells
Sent: Tuesday, 3 March 2009 10:08 AM
To: nginx at
Subject: Re: nginx vs apache as a reverse proxy

On Mon, 2009-03-02 at 17:43 +1100, Linden Varley wrote:
> I’m doing some simple testing on a FreeBSD 7.0 server comparing
> Apache2 vs Nginx as a reverse proxy to an Apache backend server. The
> backend serves mainly static images using mod_python.
> I have yet to do thorough testing but it seems as though Apache2 has
> slightly higher throughput (KB/s measured using Jmeter) when compared
> to Nginx under moderate load.

Unfortunately (and counter-intuitively) KB/s isn't completely useful
without also considering actual requests per second:

"The network I/O graph I find interesting mostly because I don’t know
how to take it. On one hand it seems Apache is simply using more
bandwidth to do the same number of requests as Nginx. Which would seem
bad. On the other it could just mean that Apache does a better job of
consuming and using the available pipe. Which would seem good. My hunch
is that it is the former."


The contents of this email are confidential and may be subject to legal or professional privilege and copyright. No representation is made that this email is free of viruses or other defects. If you have received this communication in error, you may not copy or distribute any part of it or otherwise disclose its contents to anyone. Please advise the sender of your incorrect receipt of this correspondence.

More information about the nginx mailing list