Link Details

Link 15196 thumbnail
User 214396 avatar

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...
  • 20
  • 0
  • 3328
  • 944

Comments

Add your comment
User 210175 avatar

jtheory replied ago:

0 votes Vote down Vote up Reply

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?

User 220469 avatar

gottin replied ago:

1 votes Vote down Vote up Reply

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.

User 181894 avatar

dagnyg replied ago:

0 votes Vote down Vote up Reply

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".

User 214396 avatar

yavori replied ago:

0 votes Vote down Vote up Reply

hmm I got this problem and well glad you gave this cool solution.

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.