I''m not really sure how mod_rails / passenger works but it''s producing some strange behavior for me. I wrote a simple controller action that sleeps for 5 seconds before returning the current time. I then called that action from two different computers. It took 5 seconds for the first request to finish processing and 10 seconds for the second one. That is, the second request was blocked from executing until after the first one had been finished. Why does this happen? When I call ps on the server, I see that several ruby and apache processes have been spawned. If the ruby process servicing the first request is busy, when I send the second request to the server, shouldn''t it spawn or use a different process instead of waiting for the first one to finish? -- Andrew --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On May 2, 9:55 am, Andrew Fong <FongAnd...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I''m not really sure how mod_rails / passenger works but it''s producing > some strange behavior for me. > > I wrote a simple controller action that sleeps for 5 seconds before > returning the current time. I then called that action from two > different computers. It took 5 seconds for the first request to finish > processing and 10 seconds for the second one. That is, the second > request was blocked from executing until after the first one had been > finished. > > Why does this happen? When I call ps on the server, I see that several > ruby and apache processes have been spawned. If the ruby process > servicing the first request is busy, when I send the second request to > the server, shouldn''t it spawn or use a different process instead of > waiting for the first one to finish? > > -- AndrewI can''t seem to reproduce this. I have this in my controller: def aaa sleep 5 render :text => ''aaa'' end I followed your steps. Both requests finish in 5 seconds. --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hrmmm ... so after restarting Apache, I''ve had trouble reproducing the issue as well. Any idea what that might have been? -- Andrew On May 2, 3:30 am, Hongli Lai <hongli...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On May 2, 9:55 am, Andrew Fong <FongAnd...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > I''m not really sure how mod_rails / passenger works but it''s producing > > some strange behavior for me. > > > I wrote a simple controller action that sleeps for 5 seconds before > > returning the current time. I then called that action from two > > different computers. It took 5 seconds for the first request to finish > > processing and 10 seconds for the second one. That is, the second > > request was blocked from executing until after the first one had been > > finished. > > > Why does this happen? When I call ps on the server, I see that several > > ruby and apache processes have been spawned. If the ruby process > > servicing the first request is busy, when I send the second request to > > the server, shouldn''t it spawn or use a different process instead of > > waiting for the first one to finish? > > > -- Andrew > > I can''t seem to reproduce this. I have this in my controller: > > def aaa > sleep 5 > render :text => ''aaa'' > end > > I followed your steps. Both requests finish in 5 seconds.--~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Another mod_rails question: Are global variables shared between each ruby process? On May 2, 5:24 am, Andrew Fong <FongAnd...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hrmmm ... so after restarting Apache, I''ve had trouble reproducing the > issue as well. Any idea what that might have been? > > -- Andrew > > On May 2, 3:30 am, Hongli Lai <hongli...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > On May 2, 9:55 am, Andrew Fong <FongAnd...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > I''m not really sure how mod_rails / passenger works but it''s producing > > > some strange behavior for me. > > > > I wrote a simple controller action that sleeps for 5 seconds before > > > returning the current time. I then called that action from two > > > different computers. It took 5 seconds for the first request to finish > > > processing and 10 seconds for the second one. That is, the second > > > request was blocked from executing until after the first one had been > > > finished. > > > > Why does this happen? When I call ps on the server, I see that several > > > ruby and apache processes have been spawned. If the ruby process > > > servicing the first request is busy, when I send the second request to > > > the server, shouldn''t it spawn or use a different process instead of > > > waiting for the first one to finish? > > > > -- Andrew > > > I can''t seem to reproduce this. I have this in my controller: > > > def aaa > > sleep 5 > > render :text => ''aaa'' > > end > > > I followed your steps. Both requests finish in 5 seconds.--~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On May 2, 2:50 pm, Andrew Fong <FongAnd...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Anothermod_railsquestion: Are global variables shared between each > ruby process?No. Each process has its own private memory. --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---