All, If you deploy multiple Mongrel instances, is it possible to have affinity between a given session (e.g. session id) and a Mongrel instance? How is that done? Thanks, Wes -- 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 -~----------~----~----~----~------~----~------~--~---
Tom Mornini
2007-Jan-24 02:54 UTC
Re: Are Mongrel instances "sticky" with respect to sessions?
On Jan 23, 2007, at 2:06 PM, Wes Gamble wrote:> If you deploy multiple Mongrel instances, is it possible to have > affinity between a given session (e.g. session id) and a Mongrel > instance? How is that done?Hello Wes. Session affinity is generally achieved at the load balancer level, and Apache 2.2 supports this as well. See http://httpd.apache.org/docs/2.2/mod/mod_proxy.html and search locally for lbmethod for details. Why do you want session affinity? It makes a ton of sense is HUGE installations, but not so much for smaller ones. -- -- Tom Mornini, CTO -- Engine Yard, Ruby on Rails Hosting -- Reliability, Ease of Use, Scalability -- (866) 518-YARD (9273) --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Wes Gamble
2007-Jan-24 15:51 UTC
Re: Are Mongrel instances "sticky" with respect to sessions?
> > Why do you want session affinity? It makes a ton of sense is HUGE > installations, but not so much for smaller ones. >Because I ended up having to use a custom in-memory persistence scheme to handle objects that were too large to place on the session (and would cause Rails to crash during session serialization/deserialization). So I have a hash which stores some larger things (parsed HTML and Excel spreadsheet data) that I would like to keep around across requests given the relatively high cost of generating them. If I need to go to two or more Mongrels (which I almost certainly will), the hashes will be private to each Mongrel instance (Ruby process) and won''t be shared. Which of course, implies that I might end up generating these objects up to N times where N is the number of Mongrel instances. So I would like to either take advantage of session affinity for a given Mongrel process to be sure that a given artifact generated on behalf of a given user and managed in my hash is only generated once. If session affinity doesn''t work with Mongrel, then I guess I can look into Drb. Thanks, Wes -- 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 -~----------~----~----~----~------~----~------~--~---
Wes Gamble
2007-Jan-24 15:54 UTC
Re: Are Mongrel instances "sticky" with respect to sessions?
Tom Mornini wrote:> Session affinity is generally achieved at the load balancer level, > and Apache 2.2 supports this as well. > > See http://httpd.apache.org/docs/2.2/mod/mod_proxy.html and search > locally for lbmethod for details.Tom, Thanks. Just looked at the Apache docs. and I see how this appears to be supported. Wes -- 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 -~----------~----~----~----~------~----~------~--~---
Benjamin Ritcey
2007-Jan-24 17:30 UTC
Re: Are Mongrel instances "sticky" with respect to sessions?
Wes Gamble wrote:>> Why do you want session affinity? It makes a ton of sense is HUGE >> installations, but not so much for smaller ones. >> > > Because I ended up having to use a custom in-memory persistence scheme > to handle objects that were too large to place on the session (and would > cause Rails to crash during session serialization/deserialization). So > I have a hash which stores some larger things (parsed HTML and Excel > spreadsheet data) that I would like to keep around across requests given > the relatively high cost of generating them. >...> If session affinity doesn''t work with Mongrel, then I guess I can look > into Drb. > > Thanks, > Wes >Check out memcached - http://nubyonrails.com/articles/2006/08/17/memcached-basics-for-rails sounds like your scheme implements a subset of what memcached already does. HTH, -b --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---