# Handle multiple requests at one time

**URL:** <https://www.ruby-forum.com/t/handle-multiple-requests-at-one-time/190640>\
**Category:** Rails\
**Created:** [June 24, 2010, 12:05pm UTC](https://www.ruby-forum.com/t/handle-multiple-requests-at-one-time/190640 "2010-06-24T12:05:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![wsdickerson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/34f0e0/32.png) [@wsdickerson](https://www.ruby-forum.com/u/wsdickerson)\
**Post date:** [June 24, 2010, 12:05pm UTC](https://www.ruby-forum.com/t/handle-multiple-requests-at-one-time/190640/1 "2010-06-24T12:05:47Z")

</div>

Hi,

I have the following problem: My application contains a mechanism to  
administrate some external services via a SOAP-API. If a user submit a  
SOAP-Request, he is waiting for the SOAP-Response (it’s necessary to  
show him the response). While this time the Rails application is  
‘blocked’ â€“ another users can’t do anything parallel. What is the best  
way to avoid this situation (~ to process many requests at one time)?  
Thanks & best regards

---

<div class="post-metadata">

**Author:** ![wsdickerson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/34f0e0/32.png) [@wsdickerson](https://www.ruby-forum.com/u/wsdickerson)\
**Post date:** [June 24, 2010, 12:39pm UTC](https://www.ruby-forum.com/t/handle-multiple-requests-at-one-time/190640/2 "2010-06-24T12:39:46Z")

</div>

On 24 Jun 2010, at 12:05, William D. wrote:

> I have the following problem: My application contains a mechanism to  
> administrate some external services via a SOAP-API. If a user submit a  
> SOAP-Request, he is waiting for the SOAP-Response (it’s necessary to  
> show him the response). While this time the Rails application is  
> ‘blocked’ â€“ another users can’t do anything parallel. What is the best  
> way to avoid this situation (~ to process many requests at one time)?

It depends on the number of simultaneous requests you expect to have  
going. If you’re using Passenger, it will spawn new processes when it  
needs to, other users will never know about one process being blocked.  
The same applies for mongrel cluster etc if you balance correctly.

If you expect a lot of long running processes, you should process them  
in the background. There’s several background processing solutions for  
Rails, like Nanite (which uses RabbitMQ) etc. What you basically do is  
pass on the longrunning method to an external agent and run it  
asynchronousle. Once the job is finished, the agent will execute a  
callback in your Rails app (which can be anything you would normally  
do in a Rails app). It means the user can launch webservice requests,  
do something else and then be notified once the result is available.

Best regards

Peter De Berdt
