Welcome! Log In Create A New Profile

Advanced

Re: understanding nginx proxy magic

Francis Daly
November 25, 2014 03:42AM
On Mon, Nov 24, 2014 at 05:49:12PM -0800, Johan Martinez wrote:

Hi there,

> I installed nginx as a reverse proxy in front of apache server. No
> configuration change was made on apache and nginx is simply passing all
> requests to the backend apache. Now website is more responsive and it can
> handle 1.3 times more load than just apache in picture. I am wondering
> what's nginx magic that made website faster even though apache is still
> doing almost all the work.

If you draw a picture of what is involved in the browser making a request
and getting a response in each case, you may see the difference.

Note particularly the length of time it takes the request to be received
and the response to be sent; and consider the amount of system resources
(probably mostly memory) used to do that, for that length of time.

If it takes "the web server" 10 seconds to write the response to the
client -- just because of the response size and network characteristics
-- then the old way had one apache process sitting there for 10 seconds
writing to the network, while the new way has one apache process sitting
there for one second writing to nginx and has nginx sitting there for
10 seconds writing to the network.

The nginx process doing the writing is smaller than the apache process
was; and the apache process is ready to handle the next request 9 seconds
sooner than previously.

Presumably in your case, the overhead of running an extra service (nginx)
is less than what your apache used when doing the lightweight tasks,
so you see an increase in throughput.

f
--
Francis Daly francis@daoine.org

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

understanding nginx proxy magic

Johan Martinez November 24, 2014 08:50PM

Re: understanding nginx proxy magic

Francis Daly November 25, 2014 03:42AM

Re: understanding nginx proxy magic

Valentin V. Bartenev November 25, 2014 08:22AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 162
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready