O'Reilly logo

Nginx Essentials by Valery Kholodkov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required