this is almost the easiest bug in the world to reproduce.
- set up 3 mongrels behind ngnix.
- add ‘sleep 20’ to one controller action
- open up 1 browser window and hit the sleep action
- open up another browser window and hit any other action over and
- 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.