same key on both memcached servers

4 views
Skip to first unread message

Shaulian

unread,
Jun 20, 2010, 11:22:45 AM6/20/10
to memcached
Relating to Memcached FAQ (http://code.google.com/p/memcached/wiki/
FAQ#How_does_memcached_work?), it is clear that when you use more than
on server for memcache, each key exist only one time, and only on one
server.

We are using 2 servers for memcached and 3 servers for app.
Lately we noticed that when we request the same key from AppServ1, it
returns DIFFERENT value when requesting it from AppServ2.
We tried to delete the key from BackOffice in AppServ1, but it was
still exist on AppServ2.
All the above clearly points that the key exists on each server.

We're using .NET memcached client library (http://sourceforge.net/
projects/memcacheddotnet/).

Anyone experienced such a thing ?

Brian Moon

unread,
Jun 20, 2010, 12:22:12 PM6/20/10
to memc...@googlegroups.com, Shaulian
Normal, default operation of a memcached client is to failover to the
next server when a connection fails. So it is possible to have one key
exist on more than one server. However, most clients have an option to
turn this feature off. In those cases, a failed connection would lead to
the source data being regenerated.


Brian.
--------
http://brian.moonspot.net/

dormando

unread,
Jun 20, 2010, 4:34:39 PM6/20/10
to memcached
This smells like you're configuring your clients wrong... The client list
must be _exactly the same_ on every app server. Don't reorder them or put
"localhost" in there.

It's also possible that appserv2 can't reach one of the memcached daemons
as well, and is putting keys on the only available server.

Shaulian

unread,
Jun 24, 2010, 3:55:01 AM6/24/10
to memcached
I checked the configuring of the clients, both order and not
containing any 'localhost'.
I'll check the connection between each server to the other.

Shaulian

unread,
Jun 24, 2010, 3:48:45 AM6/24/10
to memcached
Hi,
Found the Failover option, so i can test it.

Currently, only one memcached server is online, so there is no
failover possible at all, and everything is going alright (The
memcached server is accessible from both AppServ1+2+3).

Before testing the failover property (set it to false),
I will shut the currently working memcached server, turn on the second
on, and see whats happen.
Maybe the second server isn't configured well.


On Jun 20, 7:22 pm, Brian Moon <br...@moonspot.net> wrote:
> Normal, default operation of a memcached client is to failover to the
> next server when a connection fails. So it is possible to have one key
> exist on more than one server. However, most clients have an option to
> turn this feature off. In those cases, a failed connection would lead to
> the source data being regenerated.
>
> Brian.
> --------http://brian.moonspot.net/

Brian Moon

unread,
Jun 24, 2010, 12:27:24 PM6/24/10
to memc...@googlegroups.com, Shaulian
What memcached client are you using?


Brian.
--------
http://brian.moonspot.net/

Shaulian

unread,
Jul 14, 2010, 1:57:11 AM7/14/10
to memcached
Sorry for the late response.

I'm using the memcacheddotnet_clientlib-1.1.5.

On Jun 24, 7:27 pm, Brian Moon <br...@moonspot.net> wrote:
> Whatmemcachedclient are you using?
>
> Brian.
> --------http://brian.moonspot.net/
>
> On 6/24/10 12:48 AM, Shaulian wrote:
>
> > Hi,
> > Found the Failover option, so i can test it.
>
> > Currently, only onememcachedserver is online, so there is no
> > failover possible at all, and everything is going alright (The
> >memcachedserver is accessible frombothAppServ1+2+3).
>
> > Before testing the failover property (set it to false),
> > I will shut the currently workingmemcachedserver, turn on the second
> > on, and see whats happen.
> > Maybe the second server isn't configured well.
>
> > On Jun 20, 7:22 pm, Brian Moon<br...@moonspot.net>  wrote:
> >> Normal, default operation of amemcachedclient is to failover to the
> >> next server when a connection fails. So it is possible to have onekey
> >> exist on more than one server. However, most clients have an option to
> >> turn this feature off. In those cases, a failed connection would lead to
> >> the source data being regenerated.
>
> >> Brian.
> >> --------http://brian.moonspot.net/
>
> >> On 6/20/10 10:22 AM, Shaulian wrote:
>
> >>> Relating toMemcachedFAQ (http://code.google.com/p/memcached/wiki/
> >>> FAQ#How_does_memcached_work?), it is clear that when you use more than
> >>> on server for memcache, eachkeyexist only one time, and only on one
> >>> server.
>
> >>> We are using 2serversformemcachedand 3serversfor app.
> >>> Lately we noticed that when we request thesamekeyfrom AppServ1, it
> >>> returns DIFFERENT value when requesting it from AppServ2.
> >>> We tried to delete thekeyfrom BackOffice in AppServ1, but it was
> >>> still exist on AppServ2.
> >>> All the above clearly points that thekeyexists on each server.
>
> >>> We're using .NETmemcachedclient library (http://sourceforge.net/

Henrik Schröder

unread,
Jul 14, 2010, 6:40:57 AM7/14/10
to memc...@googlegroups.com
Try switching to a more actively developed client like BeITMemcached or Enyim?

http://github.com/henrikschroder/beitmemcached


/Henrik
Reply all
Reply to author
Forward
0 new messages