Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does Unicorn consider to be "fast" and "slow" requests?

Tags:

ruby

rack

unicorn

Unicorn says it's for "fast clients". Whenever I read elaboration on this, this is explained as it being appropriate for, say, being behind an nginx proxy server serving http requests, and not for running an app that does long-polling.

Okay, makes sense, but the more common case where a request is "slow" is when a POST takes a long time, either because it is streaming up a lot of data (a file upload) or because the action invokes processing in the app that takes a long time.

How does Unicorn behave in these two cases? Where can I read more about this?

like image 211
John Bachir Avatar asked Sep 20 '11 15:09

John Bachir


1 Answers

I think the idea is that Unicorn isn't made to have hundreds or thousands of open requests. Having a slow form post is fine as long as you don't have hundreds of users all posting that form simultaneously. We have several places where you can upload images on our site and those pages routinely take several seconds to upload and process the image before returning to the user and we haven't had a problem. But, we don't have thousands of users uploading images simultaneously, either.

Rainbows! is the Unicorn-like web server for long polling requests: http://rainbows.rubyforge.org/

like image 99
Rob Cameron Avatar answered Sep 18 '22 05:09

Rob Cameron