By yavori
via rubycorner.net
Published: Mar 04 2007 / 19:11
Setting up a Ruby on Rails Application in a production environment could be a bit tricky. This is because the standard servers for running ruby could serve only one request at a time. As a result if there’s a slow database connection or any other process away from the application server no other requests could be served...
Tweet
SaveShareSend
Tags: frameworks, how-to, ruby, unix-linux
Comments
jtheory replied ago:
Is that accurate? By default Ruby on Rails is *single-threaded* and can only handle a single request at a time?
For a web application framework, that just seems kind of... ridiculous.
This article seems useful as a rough outline for setting up actual multi-server clustering, but I'm still looking at it askance just based on those opening statements. I'm no RoR expert -- anyone want to clarify?
gottin replied ago:
The default WEBrick server is single-threaded for sure. I'm not so sure if mongrel_rails is single-threaded, however it can work on only on process. Recently, I had to create a webconsole with ping, mtr and similar utilities. While working with only one mongrel_rails instance if someone issued a "system ping" - the application server wasn't able to serve any other requests untill that sysmem ping finished. I solved that problem by setting up a mongrel_rails cluster with apache as described in that tutorial.
dagnyg replied ago:
It's the Ruby interpreter that is single threaded. More properly, it's threading is not reliable so it needs to be treated as being single threaded. I use a mongrel cluster and the pound reverse proxy which feeds requests to the "pack of mongrels".
yavori replied ago:
hmm I got this problem and well glad you gave this cool solution.
Voters For This Link (20)
Voters Against This Link (0)