We''ve been using memcached to store sessions across our mongrel
cluster but we''ve noticed that when apache switches us to a different
mongrel our session dies and we get logged out. Further, when I switch
mongrels manually (using different ports) the same thing happens. I''ve
been hunting around for the last couple of days on this but to no
avail so I thought I would ask the experts.
There are two versions, the version from err''s blog and an updated one
that seems like it''s more in line with memcache-client 1.3.0 options.
They perform exactly the same.
Also below is a sample dump from memcached -vv
Thanks in advance for any advice!
Sincerely,
Chuck Vose
====================
Here is my environment.rb:
Rails::Initializer.run do |config|
config.action_controller.session_store = :mem_cache_store if
RAILS_ENV = ''production''
config.plugins = ["engines","*"]
end
memcache_options = {
:namespace => "nef_#{RAILS_ENV}",
:readonly => false,
:multithread => true
}
CACHE = MemCache.new(''localhost:11211'', memcache_options)
ActionController::Base.session_options[:expires] = 1800
ActionController::Base.session_options[:cache] = CACHE
--- OR ---
Rails::Initializer.run do |config|
config.action_controller.session_store = :mem_cache_store if
RAILS_ENV = ''production''
config.plugins = ["engines","*"]
end
require ''memcache''
memcache_options = {
:c_threshold => 10_000,
:compression => true,
:debug => false,
:namespace => "nef_#{RAILS_ENV}",
:readonly => false,
:multithread => true
:urlencode => false
}
CACHE = MemCache.new memcache_options
CACHE.servers = ''localhost:11211''
ActionController::Base.session_options[:expires] = 1800
ActionController::Base.session_options[:cache] = CACHE
====================
<6 new client connection
<6 get
nef_production:session:d9ac0790bc2de7fc10924ac10794afb1>6 sending key nef_production:session:d9ac0790bc2de7fc10924ac10794afb1
>6 END
<6 set nef_production:session:d9ac0790bc2de7fc10924ac10794afb1 0 1800
456>6 STORED
<6 get
nef_production:session:d9ac0790bc2de7fc10924ac10794afb1>6 sending key nef_production:session:d9ac0790bc2de7fc10924ac10794afb1
>6 END
<6 set nef_production:session:d9ac0790bc2de7fc10924ac10794afb1 0 1800
658>6 STORED
<6 get
nef_production:session:d9ac0790bc2de7fc10924ac10794afb1>6 sending key nef_production:session:d9ac0790bc2de7fc10924ac10794afb1
>6 END
<6 set nef_production:session:d9ac0790bc2de7fc10924ac10794afb1 0 1800
658>6 STORED
<7 new client connection
<7 get
nef_production:session:d9ac0790bc2de7fc10924ac10794afb1>7 sending key nef_production:session:d9ac0790bc2de7fc10924ac10794afb1
>7 END
<7 set nef_production:session:d9ac0790bc2de7fc10924ac10794afb1 0 1800
456>7 STORED
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
Chuck, did you solved this? -- 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 -~----------~----~----~----~------~----~------~--~---
alexander-0M91wEDH++c@public.gmane.org
2007-May-15 18:50 UTC
Re: Memcache storage failing across mongrels
dear sender, i´m out of the office until may 29th. your email will not be forwarded. for urgent stuff please contact joern-0M91wEDH++c@public.gmane.org kind regards, alexander --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---