Book Image

Nginx Essentials

By : Valery Kholodkov, Valery I Kholodkov
Book Image

Nginx Essentials

By: Valery Kholodkov, Valery I Kholodkov

Overview of this book

Table of Contents (13 chapters)

Optimizing buffer allocation


Nginx uses buffers to store request and response data at various stages. Optimal buffer allocation can help you spare memory consumption and reduce CPU usage. The following table lists directives that control buffer allocation and the stages they are applied to:

Directive

Function

client_body_buffer_size <size>

This specifies the size of the buffer that is used to receive the request body from the client.

output_buffers <number> <size>

This specifies the number and the size of buffers that are used to send the response body to the client in case no acceleration is used.

gzip_buffers <number> <size>

This specifies the number and the size of the buffers that are used to compress the response body.

proxy_buffers <number> <size>

This specifies the number and the size of the buffers that are used to receive the response body from a proxied server. This directive makes sense only if buffering is enabled.

...