"Read error: #<IOError: closed stream>" and uploads

Eric Wong normalperson at yhbt.net
Mon Jan 24 22:17:57 EST 2011


Alexey Bondar <alexey.bondar at gmail.com> wrote:
> On Jan 25, 2011, at 03:51 , Eric Wong wrote:
> > Wait, nginx buffered the body to disk when client_body_buffer_size is
> > 128mb and you have trouble with a 150kb request?
> 
> Oops, my fault: not body_buffer_size, but client_max_body_size.  client_body_buffer_size is 128k.
> 
> As I understand, in this case nginx should buffer whole request body, before sending to backend? 

Yes, nginx always buffers the whole request body

> >> Same issue with 1.1.x
> > 
> > OK.  Which timeout exactly are you hitting in nginx?  
> 
> Logs: 
> 2011/01/23 21:09:05 [warn] 79095#0: *261 a client request body is buffered to a temporary file /var/spool/nginx-client-body/3/00/0000000003

<snip>

> 2011/01/23 21:09:35 [error] 79095#0: *261 upstream timed out (60: Operation timed out) while sending request to upstream

<snip>

Very strange.  Do you process env["rack.input"] directly from your app
or do you let Rails/Rack handle everything?

This probably won't help, but can you try increasing the
proxy_send_timeout in nginx?  What's your Unicorn timeout?



More information about the mongrel-unicorn mailing list