unicorn Ruby/Rack server user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
* unicorn behind apache with file uploads
@ 2010-08-15 15:50 Surendra Singhi
  2010-08-15 22:56 ` Eric Wong
  0 siblings, 1 reply; 2+ messages in thread
From: Surendra Singhi @ 2010-08-15 15:50 UTC (permalink / raw)
  To: mongrel-unicorn

Hi,

For one of our apps we switched to unicorn from mongrel.
The unicorn server use to run behind an apache with timeout of 300sec,
as sometime the customer may do a large file upload.

After we made the switch we started getting lots of
Unicorn::ClientShutdown occurred in photos#flash_upload
bytes_read=2762663 (pr some other number)
We were not able to recreate it in our tests, but support was getting
customer emails, that the files upload is not working.
It finally forced us to switch back to mongrel.

I know a fully buffering reverse proxy like nginx is advised as
reverse proxy for unicorn, but apache has been serving us well, and we
don't want to change it.
Any idea what can be going wrong, or why was unicorn throwing these errors?

Thanks!
-- 
Surendra
_______________________________________________
Unicorn mailing list - mongrel-unicorn@rubyforge.org
http://rubyforge.org/mailman/listinfo/mongrel-unicorn
Do not quote signatures (like this one) or top post when replying


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: unicorn behind apache with file uploads
  2010-08-15 15:50 unicorn behind apache with file uploads Surendra Singhi
@ 2010-08-15 22:56 ` Eric Wong
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Wong @ 2010-08-15 22:56 UTC (permalink / raw)
  To: unicorn list

Surendra Singhi <singhi.surendra@gmail.com> wrote:
> Hi,
> 
> For one of our apps we switched to unicorn from mongrel.
> The unicorn server use to run behind an apache with timeout of 300sec,
> as sometime the customer may do a large file upload.
> 
> After we made the switch we started getting lots of
> Unicorn::ClientShutdown occurred in photos#flash_upload
> bytes_read=2762663 (pr some other number)
> We were not able to recreate it in our tests, but support was getting
> customer emails, that the files upload is not working.
> It finally forced us to switch back to mongrel.

Hi Surendra,

Could you be hitting a timeout in your Apache config?  Can you try
simulating a slow connection to reproduce it?  Apache defaults to 300s,
too, so double check your config and make sure it's not different
anymore.   The other thing could be your kernel listen queue used by
Unicorn is completely full and Apache is just giving up on certain
requests...

> I know a fully buffering reverse proxy like nginx is advised as
> reverse proxy for unicorn, but apache has been serving us well, and we
> don't want to change it.
> Any idea what can be going wrong, or why was unicorn throwing these errors?

While it's generally bad for Unicorn to run behind anything other than
nginx, "generally bad" does not apply to the case of file uploads.

Honestly, when dealing with file uploads from slow clients,
Unicorn is the WORST SERVER YOU COULD EVER PICK.  EVER :)

Really, trust me on this one :)


Use nginx, but if you insist on using Apache, then you're far better off
sticking with Mongrel or trying out Rainbows![1] for uploads.

Rainbows! has the advantage of using Unicorn's prefork and shared
listeners along with your choice of threads/fibers/events/fibers/actors.

[1] - http://rainbows.rubyforge.org/

-- 
Eric Wong
_______________________________________________
Unicorn mailing list - mongrel-unicorn@rubyforge.org
http://rubyforge.org/mailman/listinfo/mongrel-unicorn
Do not quote signatures (like this one) or top post when replying


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-08-15 22:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-15 15:50 unicorn behind apache with file uploads Surendra Singhi
2010-08-15 22:56 ` Eric Wong

Code repositories for project(s) associated with this public inbox

	https://yhbt.net/unicorn.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).