Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

My nginx server is buffering all data POSTed by client, and when it has all data, it writes the data to fastcgi socket. How can we avoid that delay, and let fastcgi start receiving the data bit-by-bit, as soon as it's received from client ? I tried to play with fastcgi settings but no luck. Thanks

share|improve this question

1 Answer 1

as far as I know this is not possible

1) client_body_buffer_size is the directive which handles the client request buffer size. This is used to handle POST data, meaning form submissions, file uploads etc.

http://wiki.nginx.org/HttpCoreModule#client_body_buffer_size

if the request body size is more than the buffer size, then the entire (or partial) request body is written into a temporary file.

2) Buffering can't be disabled for fastcgi. Maxim Dounin explained that in details here http://www.ruby-forum.com/topic/197216

share|improve this answer
    
But the link you gave is talking about the data transmission FROM fastcgi backend TO the client. My problem is that the data sent FROM the client TO fastcgi THROUGH nginx is buffered. My app is handling file uploads and I need to display a progress bar, that's why I must receive the data as soon as the client sends it. –  Antares Aug 24 '12 at 15:28
    
I agree. but first link mentioned that this is true in both directions. –  hostmaster Aug 24 '12 at 15:54
    
I recommend letting Nginx do its job and buffer the entire request body before calling the backend service. This has the advantage that slow uploaders don't take up any resources in your backend, until the request is ready to be processed. If you need upload progress, you can have Nginx provide such info, using this: wiki.nginx.org/HttpUploadProgressModule –  Tobia Oct 29 '13 at 16:15

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.