This is because rails is single-threaded and cannot handle more than one request at a time. Try HAproxy, which has a more intelligent load balancer which can limit number of simultaneous connections to a backend (in mongrel's case running rails, it should be 1).
Try swiftiply and evented mongrels too and see how it goes for you. Later, Vish On 10/20/07, famoseagle <[EMAIL PROTECTED]> wrote: > > wait... i think i figured it out. set the number of mongrel threads to > 1 when you start up mongrel (via -n 1). seems like this should be the > default when you have a proxy in front of mongrel. > > On Oct 19, 5:30 pm, famoseagle <[EMAIL PROTECTED]> wrote: > > this is almost the easiest bug in the world to reproduce. > > > > 1) set up 3 mongrels behind ngnix. > > 2) add 'sleep 20' to one controller action > > 3) open up 1 browser window and hit the sleep action > > 4) open up another browser window and hit any other action over and > > over > > 5) watch as every 3rd request hangs > > > > this may seem like a contrived test but when that 'sleep 20' is > > actually a long running db query you'll see very quickly how it can > > adversely affect your site. > > > > the problem seems to be that nginx will keep forwarding requests to > > mongrel since mongrel will happily accept them. the mutexed rails > > thread is hanging and not mongrel. you can also reproduce this issue > > with apache and mod_proxy_balancer. > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Deploying Rails" group. To post to this group, send email to rubyonrails-deployment@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-deployment?hl=en -~----------~----~----~----~------~----~------~--~---