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

Eric Wong normalperson at yhbt.net
Mon Jan 24 19:51:52 EST 2011


Alexey Bondar <alexey.bondar at gmail.com> wrote:
(back to mailing list)
> On Jan 24, 2011, at 21:19 , Eric Wong wrote:
> > Eric Wong <normalperson at yhbt.net> wrote:
> >> Alexey Bondar <alexey.bondar at gmail.com> wrote:
> >>> Hi. 
> >>> 
> >>> Unicorn 3.3.1 fails with "Read error: #<IOError: closed stream>" on request with attachments bigger than ~150kb. 
> >>> 
> >>> Ruby: 1.9.2-p0
> >>> Rails: 3.0.1
> >>> 
> >>> Full stack trace: http://pastie.org/private/w1vwhbhdm9xtwwnpqog6wa
> >>> Configuration: http://pastie.org/private/hdpiqs0d3xj3qmsjwg
> >>> 
> >>> I use nginx 0.8.x as frontend server. Nginx client_body_buffer_size is 128mb.
> >> 
> >> Anything in the nginx error log?  Did this happen with Unicorn 1.1.x?
> >> The input code changed in the 3.x series drastically to support
> >> non-rewindable input, so some bugs could've crept in.
> 
> In nginx log only two messages: body buffered to disk and backend timeout. 

Wait, nginx buffered the body to disk when client_body_buffer_size is
128mb and you have trouble with a 150kb request?

> Same issue with 1.1.x

OK.  Which timeout exactly are you hitting in nginx?  How slow is your
client?  Is your request queue very huge and you don't have enough
Unicorn workers to handle the load?

-- 
Eric Wong


More information about the mongrel-unicorn mailing list