Memcached Error

J

Jean Verger

Hi,

I'm running memcached in 2 servers. Both servers, are at the same time
clients (they share memcached).

If only one server is up, there is no problem, it works perfect. It
can access both memcached servers. Same with the other server.

However, if both servers are trying to access the 2 memcached servers,
then i'm getting random errors (null values retrieved).

Please, could someone take a look to this simple config in Ruby?? why
errors when both accessing?


require 'memcache'

memcache_options = {
:c_threshold => 10_000,
:compression => false,
:debug => false,
:namespace => "Server5-Wablet-API",
:readonly => false,
:urlencode => true
}

memcache_servers = [ '209.190.6.226:9300', '209.190.6.122:9300' ]
Rails::Initializer.run do |config|
...
config.action_controller.session_store= :mem_cache_store
...
end

CACHE = MemCache.new(memcache_options)
CACHE.servers = memcache_servers
ActionController::Base.fragment_cache_store = :mem_cache_store ,{}
ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS.merge!({ 'cache'
=> CACHE })

thanks,

Jean
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,114
Latest member
GlucoPremiumReview
Top