Unicorn and streaming in Rails 3.1
normalperson at yhbt.net
Sat Jun 25 16:33:29 EDT 2011
Xavier Noria <fxn at hashref.com> wrote:
> If it is a real bad idea, is the recommendation
> to Unicorn users that they should just ignore this new feature?
Another thing, Rainbows! + ThreadSpawn/ThreadPool concurrency may do the
trick (without needing nginx at all). The per-client overhead of
Rainbows! + threads (several hundred KB) is higher than nginx, but still
much lower than Unicorn.
All your Rails code must be thread-safe, though.
If you use Linux, XEpollThreadPool/XEpollThreadSpawn can be worth a
try, too. The cost of completely idle keepalive clients should be
roughly inline with nginx.
If you want to forgo thread-safety, Rainbows! + StreamResponseEpoll
+ ForceStreaming middleware may also be an option, too (needs nginx).
Keep in mind that I don't know of anybody using Rainbows! for any
serious sites, so there could still be major bugs :)
 currently in rainbows.git, will probably be released this weekend...
 I'll probably move this to Rainbows! instead of a Unicorn branch:
This is 100% untested, I've never run it.
More information about the mongrel-unicorn