Manoel Lemos
2007-May-15  19:07 UTC
Mongrel Cluster & Memcached Sessions Issues: session is lost
Gents,
  I''m having very strange issues in my setup:
  front-end: 1 x apache + mod_proxy_balancer
  app servers: 12 x mongrels
  session store: 1 x memcached (512MB)
  I configured both the local session date (stored on memcached) for 29
(seems that it cant be more than 30 days, this is a limitation of
memcached) days of expiration and the session cookies for one year of
expiration but my users still have to login again and again in very
short periods of time.
  My environment.rb has:
Rails::Initializer.run do |config|
  # Memcache Configuration
  memcache_options = {  :c_threshold => 10_000,
                        :compression => true,
                        :debug => false,
                        :namespace => ''mysite.com'',
                        :readonly => false,
                        :urlencode => false }
  CACHE = MemCache.new(memcache_options)
  CACHE.servers = ''127.0.0.1:10001''
  # Cache Storage Configuration
  config.action_controller.fragment_cache_store = CACHE, {}
  # Session Storage Configuration
  session_options = {   :cache => CACHE,
                        :session_key => ''_bbsession'',
                        :session_domain => ''.mysite.com'',
                        :session_expires => 3.months.from_now,
                        :expires => 29.days }
  config.action_controller.session_store = :mem_cache_store
  ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS.update(session_options)
end
  More, I tried to debug that and I could prove that after
leaving/closing the browser and opening it again (not entering the site
yet) both the local (memcached) and remote (cookies) session data is
available, but mongrels don''t find them and then the user needs to
login
again.
  I''m wondering if this is related to the load balancing or something
else.
  Any ideas, suggestions?
Manoel Lemos
Computer Engineer
Email: manoel-FXdXQwEU78FeoWH0uzbU5w@public.gmane.org
-- 
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
-~----------~----~----~----~------~----~------~--~---