Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Hey Evan,

I keep reading how Puma is meant for be run multi-threaded on JRuby or Rubinius.

Would it be non-sense to run it in "cluster" mode (multi-process) under MRI 2.0? Similar to how we'd run Unicorn, for example. Any benefits doing that versus just running Unicorn?

EDIT: we have plenty of ram so that's not really a concern



Yeah, you can certainly run puma in the same operational mode as unicorn with clustering. But what I'd suggest is that you do instead is creating 1.5 as many workers has you have cores in your machine and perhaps 8 threads per worker. With that configuration, you'll get much more even performance than unicorn because you won't get as much cpu thrashing from context switches between processes and the threads will allow a high number of concurrent requests to all make progress concurrently.


Hi Evan, thanks for your great work on Puma. Back in the days Mongrel was already multithreaded but it never reached its full potential because multithreading in the Rails world was so messed up back then. I'm glad to see that you've developed it into such a good state. When I checked your code, it was simple, clean and easy to read. Wonderful technology.

Unicorn currently does have better fault-tolerance tools than Puma though, e.g. the 1-minute timeout on that Unicorn has by default. Unicorn also currently has more documentation than Puma. So there is a tradeoff in the choice, and there's still plenty that all the app servers can learn from each other.


8 threads per worker on MRI? Isn't that a recipe for disaster? Or maybe I'm missing something?


Why would that be recipe for disaster? What do you think would happen?


Aren't threads on MRI evil?


No? I don't know what your referencing.




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: