Request for information on client_body_in_single_buffer config option

Maxim Dounin mdounin at mdounin.ru
Thu Feb 4 02:05:33 UTC 2016


Hello!

On Wed, Feb 03, 2016 at 10:43:06AM -0800, Dilip Simha wrote:

> Hi,
> 
> I am curious to know as to why the nginx.conf config
> variable: client_body_in_single_buffer is turned off by default?
> 
> Is there any performance degradation when its turned on?
> In my understanding when this is turned on, it should help improve the
> performance by reading the entire body in a single memcopy operation. Isn't
> it?

This option has both pros and cons:

- on the one hand, it saves resources when you have to access 
  request body as a single memory block - e.g., via $request_body 
  variable;

- on the other hand, it wastes resources when nginx is reading 
  body from client, as it has to do an extra allocation and 
  memcpy() if some parts of the body happened to be already read 
  with the request header.

Additonally, right now this option does not work at all and marked 
as TODO.  See src/http/ngx_http_request_body.c for details.

-- 
Maxim Dounin
http://nginx.org/



More information about the nginx-devel mailing list