> is a single thread(ruby green thread) created for everyone request?
I'm going to go out on a limb here since no others have responded, but 
my understanding (at least in the current version of Rails) is no. I 
don't believe than a thread is created at all. It is my understanding 
that the Rails application instance is a single processes thread that 
handles the request all the way through to the response. The Rails 
application instance will block from the time it receives a request to 
the time it completes the response.

To handle requests concurrently you need to have multiple Rails 
processes running. Typically you would use a Mongrel cluster for this. 
For best performance you also need a load balancer that is smart enough 
to know not to send a request to a busy Rails instance, otherwise, that 
request will be blocked until the Rails process completes it's current 
request.

However, my understanding is the Mongrel, or Thin or whatever is 
concurrent and will queue up the request that it sends to the Rails 
instance for processing.

That being said this is not that unusual. I believe that PHP 
applications would work in a similar way. They would spin up a process 
to handles each request. One process handling one request.

This is actually a safe and scalable solution. Threading is HARD! And, 
it's dangerous if not done correctly. And in the end it doesn't really 
help you scale as much as you might expect.

I'll reiterate that this is my own understanding of this, and I could be 
completely off-base.

Pokkai Dokkai wrote:
> i don't understand that request ... response process in rails framework
> .
> 
> is a single thread(ruby green thread) created for everyone request?
> then that single thread will be living upto the response send.
> am i correct ?

-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to