3 ms·
So after reading this I can't see a single disadvantage to using Unicorn. Is there any reason why I shouldn't immediately switch from thin?
by habosa 14y ago
So after reading this I can't see a single disadvantage to using Unicorn. Is there any reason why I shouldn't immediately switch from thin?
- fdr 14y agoThe downside is use of more memory that can cause an out-of-memory condition, and the subsequent guesswork as to what the concurrency factor ought to be. However, it is often a really good idea for most applications that don't need a whole lot of memory and spend a long of time waiting (for databases, the client, or whatever). Quite some time ago I wrote (mostly for my own entertainment) a little example project to try to cut Dyno use for Python programs, although many of the precepts are exactly the same: https://github.com/fdr/double-boiler https://github.com/fdr/double-boiler
- 33degrees 14y agoI've been running unicorn for a while, and the only real issue I've run into is apps taking too long to start up and their processes getting killed. Turning preload_app off seems to fix it, though.
- bretthopper 14y agoUnicorn is only meant for "fast clients" and they specifically say that "slow clients" should be served by a reverse proxy like nginx. I put those terms in quotes since they're subjective. But I've read that Fast Clients are only those on a LAN. So basically, Unicorn should NEVER be directly exposed to a user. Problem is, Heroku doesn't run a reverse proxy anymore on its Cedar stack. Rainbows[1] is a server based on Unicorn but designed to also handle longer requests/slow clients. [1]http://rainbows.rubyforge.org/ http://rainbows.rubyforge.org/
- habosa 14y agoWhy does the speed of the client matter?
- bretthopper 14y agoThis is a good read about it: http://unicorn.bogomips.org/PHILOSOPHY.html http://unicorn.bogomips.org/PHILOSOPHY.html
- lucaspiller 14y agoIs there a good explanations of why Rainbows is better than Unicorn for slow clients? All I seem to have read is that it is better, but without going into details what is different. We use Nginx in front of Unicorn as suggested, however we also do synchronous file uploads and thumbnailing, the process takes a while (maybe 20 seconds) and I would like to understand whether we should be using Rainbows for this.