Reverse proxy performance tuning
NGINX can be tuned in a number of ways to get the most out of the application for which it is acting as a reverse proxy. By buffering, caching, and compressing, NGINX can be configured to make the client's experience as snappy as possible.
Buffering data
Buffering can be described with the help of the following diagram:
The most important factor to consider performance-wise when acting as a reverse proxy is buffering. NGINX, by default, will try to read as much as possible from the upstream server as fast as possible before returning that response to the client. It will buffer the response locally so that it can deliver it to the client all at once. If any part of the request from the client or the response from the upstream server is written to disk, performance might drop. This is a trade-off between RAM and disk. So, it is very important to consider the following directives when configuring NGINX to act as a reverse proxy:
Proxy module buffering directives... |
---|