Does anyone knows how to set concurrency=true for mongrel. For webrick
we can set that in lib/webrick_server.rb at
line 80 :
REQUEST_MUTEX.lock unless ActionController::Base.allow_concurrency
Is there something similar possible in mongrel, and where?
Andreas is right, Rails is single-threaded and that's why the
recommended approach is to use Apache to proxy Rails and handle the
static content in front of a pack of mongrel processes.
- Mongrel serves static files directly, without telling rails anything about it.
- You will need to find rails handler in mongrel source,
rails_handler.rb iirc and disable mutex around request serving part,
and also set ActionController::Base.allow_concurrency = true in your
environment file.
- Don't do it if you don't know what you're doing
- Have fun.
But in my context the two concurrent requests retrieve dynamic content
from the server and are getting locked because I don't know. Whether
it's because of rails or because of mongrel. , badly confused now
Serving a static file doesn't keep a mongrel process busy due it's
threaded model, unless of course you're doing it from rails using
send_data/send_file ( which you should never ever do ).