Page 24 of Ez's Mongrel presentation (http://brainspl.at/
mongrel_handlers.pdf) suggests he gets good throughput by doing
routing processing etc before starting the mutex lock.
[I've not looked at this code for Rails nor Merb] - is this something
we can port to Rails? Anyone written about this already in this forum
or blogs (to save you writing it up again!
Living without AsyncIO and using green threads makes me suspicious
that it'll make a difference in a full application. However if people
take a look, improve the thread safety, run relevant and accurate
benchmarks, and show an improvement, I can't see why we wouldn't be
I'm just not necessarily sure that all those steps are a worthwhile
investment, nor that thread safety will yield performance improvements
relative to profiling an indicative app and fixing what's slow.
No matter how trimmed down the mutex lock is, it's still there, and
you don't want your users to be queuing within mongrel when there are
processes available elsewhere to service their requests. Because of
this you'll probably always want your load balancers to be doling out
one request at a time, so additional thread safety won't buy you a
whole lot of anything...