# Memcached Error

**URL:** <https://www.ruby-forum.com/t/memcached-error/69352>\
**Category:** Ruby\
**Created:** [September 20, 2006, 1:48pm UTC](https://www.ruby-forum.com/t/memcached-error/69352 "2006-09-20T13:48:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jverger](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/49beb7/32.png) [@jverger](https://www.ruby-forum.com/u/jverger)\
**Post date:** [September 20, 2006, 1:48pm UTC](https://www.ruby-forum.com/t/memcached-error/69352/1 "2006-09-20T13:48:34Z")

</div>

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
