Hi, 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? ~Shishir --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Don''t do it. Rails is not thread safe, you will get all kinds of problems. Andreas -- 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 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 -~----------~----~----~----~------~----~------~--~---
Hi Shishir 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. On Sep 26, 10:13 pm, Andreas Schwarz <rails-mailing-l...@andreas- s.net> wrote:> Don''t do it. Rails is not thread safe, you will get all kinds of > problems. > > Andreas > -- > Posted viahttp://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 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 -~----------~----~----~----~------~----~------~--~---
- 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. On 9/26/07, CCH <cch-Z/Eug3sLCsSPzdAsCNHSEg@public.gmane.org> wrote:> > Hi Shishir > > 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. > > > On Sep 26, 10:13 pm, Andreas Schwarz <rails-mailing-l...@andreas- > s.net> wrote: > > Don''t do it. Rails is not thread safe, you will get all kinds of > > problems. > > > > Andreas > > -- > > Posted viahttp://www.ruby-forum.com/. > > > > >-- Cheers! - Pratik http://m.onkey.org --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
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 SOS !! On Sep 26, 8:23 pm, Pratik <pratikn...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> - 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. > > On 9/26/07, CCH <c...-Z/Eug3sLCsSPzdAsCNHSEg@public.gmane.org> wrote: > > > > > > > Hi Shishir > > > 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. > > > On Sep 26, 10:13 pm, Andreas Schwarz <rails-mailing-l...@andreas- > > s.net> wrote: > > > Don''t do it. Rails is not thread safe, you will get all kinds of > > > problems. > > > > Andreas > > > -- > > > Posted viahttp://www.ruby-forum.com/. > > -- > Cheers! > - Pratikhttp://m.onkey.org--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
No one can say a word without looking at the code :) On 9/27/07, Shishir Srivastava <shishir.srivastava-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > 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 > > SOS !! > > > On Sep 26, 8:23 pm, Pratik <pratikn...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > - 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. > > > > On 9/26/07, CCH <c...-Z/Eug3sLCsSPzdAsCNHSEg@public.gmane.org> wrote: > > > > > > > > > > > > > Hi Shishir > > > > > 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. > > > > > On Sep 26, 10:13 pm, Andreas Schwarz <rails-mailing-l...@andreas- > > > s.net> wrote: > > > > Don''t do it. Rails is not thread safe, you will get all kinds of > > > > problems. > > > > > > Andreas > > > > -- > > > > Posted viahttp://www.ruby-forum.com/. > > > > -- > > Cheers! > > - Pratikhttp://m.onkey.org > > > > >-- Cheers! - Pratik http://m.onkey.org --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Shishir Srivastava wrote:> 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 nowIt''s because one mongrel can only serve one rails request at a time. To handle multiple requests at the same time you need a mongrel cluster or a FastCGI/LSAPI setup. -- 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 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 -~----------~----~----~----~------~----~------~--~---
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 ).> It''s because one mongrel can only serve one rails request at a time. To > handle multiple requests at the same time you need a mongrel cluster or > a FastCGI/LSAPI setup. > -- > Posted via http://www.ruby-forum.com/. > > > >-- Cheers! - Pratik http://m.onkey.org --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Depends on how many people will be using your site at once. I use send_data just fine with the software I have written for a small lab. On Sep 27, 6:47 am, Pratik <pratikn...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> 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 ). > > > It''s because one mongrel can only serve one rails request at a time. To > > handle multiple requests at the same time you need a mongrel cluster or > > a FastCGI/LSAPI setup. > > -- > > Posted viahttp://www.ruby-forum.com/. > > -- > Cheers! > - Pratikhttp://m.onkey.org--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
And also, they have memory leaking related issues. On 9/27/07, Cache22 <craigknox-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Depends on how many people will be using your site at once. I use > send_data just fine with the software I have written for a small lab. > > On Sep 27, 6:47 am, Pratik <pratikn...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > 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 ). > > > > > It''s because one mongrel can only serve one rails request at a time. To > > > handle multiple requests at the same time you need a mongrel cluster or > > > a FastCGI/LSAPI setup. > > > -- > > > Posted viahttp://www.ruby-forum.com/. > > > > -- > > Cheers! > > - Pratikhttp://m.onkey.org > > > > >-- Cheers! - Pratik http://m.onkey.org --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---