proxy_busy_buffers_size

The proxy_busy_buffers_size directive sets the size of the buffer used for storing the response from a proxied server when NGINX is busy.

Syntaxproxy_busy_buffers_size size;
Default8k
Contexthttp, server, location
Arguments1

Description

The proxy_busy_buffers_size directive is crucial in managing how NGINX handles responses from upstream servers during periods of high load. When NGINX processes requests to a proxied server, it uses buffers to hold the data received before sending it to the client. The proxy_busy_buffers_size specifically determines how much memory is allocated for these buffers when NGINX is busy serving concurrent requests. A key aspect of its functionality is to reduce the risk of server overload by limiting the amount of memory consumed by these busy buffers.

Setting this directive helps manage memory usage more effectively, especially under high traffic scenarios. By providing a specific size for proxy_busy_buffers_size, administrators can balance between performance and resource consumption. If the size is set too small, it may lead to more frequent buffer flushing and increased response times due to higher resource contention. Conversely, setting it too high could lead to excessive memory usage, potentially resulting in server instability when under heavy load. Hence, it’s important to find an optimal value based on server capabilities and expected traffic patterns.

Config Example

http {
    proxy_busy_buffers_size 16k;
}

Setting the value too low may increase the number of flush operations, degrading performance.

Setting it too high can lead to excessive memory usage, especially under heavy load.

← Back to all directives