Topic: mongrel-cluster does not support parallel request!?

Hi there,

I just found out that mongrel-cluster cannot process two request on the same controller/action.  I hope I can get my point across with this example:

two different action in the same controller:

1) example_controller/action1:
def action1
   sleep 10.0
   render :text => "action1 done #{Time.new}"
end

2) example_controller/action2:
def action1
   sleep 10.0
   render :text => "action1 done #{Time.new}"
end

If I set a mongrel-cluster with more than 1 process, action1 and action2 can be carried out in parallel. No problem here.

However, two request to example_controller/action1 are run sequentially, not in parallel. I though that the processes in mongrel-cluster where completely independent, but it looks like rails is locking a mutex somewhere even between different mongrel processes.

Do you know how to solve this problem?

Unfortunately, one of the actions in my web application takes more than 3 seconds to complete due to heavy computation. If I cannot run that in parallel I'm basically screwed. By the way, I'm new to RoR, please be gentle. Thanks a lot!

solso

Re: mongrel-cluster does not support parallel request!?

Mongrel server instances serve up to 3 requests per an instance I believe. It's all queue based though. In your case, I'd consider sending in your "3 second computation" to a worker daemon and having it run in the background, that way it doesn't hold up your http connections.

http://danielfischer.com - Personal Web-Technology-Blog, Los Angeles.