Welcome! Log In Create A New Profile

Advanced

how to completely disable buffering request body

August 23, 2016 12:34PM
Hi all,

for one of our products we have chosen nginx as our webserver and using
fastCGI to talk to upstream(application) layer. We have a usecase where in
the client sends huge payload typically in MB and nginx is quick enough
reading all the data and buffering it . Whereas our upstream server is
quite slower in consuming the data. This resulted in timeout on client
side since the upstream cant respond with status code until unless it
finish reading the complete payload. Additional information is, the request
is chunked.

To address this we have tried several options but nothing worked out so
far.

1. we turned off fastcgi_request_buffering setting it to off.

This would only allow nginx not to buffer request payload into a temp file
before forwarding it to application/upstream. But it still use some buffer
chains to write to upstream.

2. setting client_body_buffer_size .

this would only check if request body size is larger than
client_body_buffer_size, then it writes whole or part of body to file.
How does this work in case of chunked request body?
What is the max chunk size that nginx can allocate?
What if upstream is slow in consuming the data and nginx still tries to
writev chain of buffers to the pipe?
How many max chain buffers nginx would maintain to buffer request body? If
so is it configurable?


What other options that we can try out? we want to completely disable
request body buffering and would want to stream the data as it just arrives
from client. and if upstream is busy , nginx should be able to tune itself
in the sense it should wait reading further data from client until upstream
is ready to be written.

Any help is much appreciated as this is blocking one of our product
certifications.

Thanks
Prasad.
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

how to completely disable buffering request body

Phani Sreenivasa Prasad 842 August 23, 2016 12:34PM

Re: how to completely disable buffering request body

Maxim Dounin 316 August 23, 2016 01:08PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 206
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready