M
M
Mikhail Svarichevsky2018-11-04 02:22:53
Nginx
Mikhail Svarichevsky, 2018-11-04 02:22:53

Nginx reverse proxy: What is the performance impact of proxy_buffering on large files and slow upstream?

The documentation says that when proxy_buffering is disabled, a response from the backend server is sent to clients simultaneously with its receipt, and when it is enabled, the response is read into buffers, and, if necessary, written to a file, and only then sent to the client.
If we have a "slow but large" backend (large storage on ordinary disks) - of course, we want to give the client data at the same time as receiving it in order to minimize the delay for the client.
However, in practice, when testing on 100Mb files and a slow network (2Mb/s for both backend and clients), there is a feeling that nginx is leaking data to the client as it loads from the backend, even with proxy_buffering enabled.
Is there an inaccuracy in the documentation, or is the behavior of nginx more complicated? Do I understand correctly that if nginx starts sending data to clients immediately, then there is no point in turning off proxy_buffering?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Valentine, 2018-11-16
@ProFfeSsoRr

Buffers are not 100Mb, he filled the buffer - and sends it, but for now he fills the next one. See the nginx documentation on proxy_buffering and read the options below, where you can set the number and size of buffers.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question