Am I reading you correctly, in that you want to set up a hot spare memcached-daemon on the same machine?

To what purpose would you do that? Memcached is very stable (ours is running for a year now), so it basically won't die by itself. I don't really understand why you would want to kill it, but I'm assuming that's a very rare occasion as well. You're normally better off by either changing the key-names and let expiration times take care of the deprecated keys or simply clearing the cache.

A restart is normally pretty quick, so I'd wager you won't need a hot spare in that rare case you really needed to kill/restart it.

As for hot spare. You normally set that up in case your primary resource goes out. And having an active and a hot spare instance on a single machine won't ward you against machine failure.

Basically, if you don't need a cache larger than a single machine's memory, I'd not try and set a hot spare up the way you do. But on a separate machine... Unfortunately that's relatively complicated to do, especially if you want to keep it transparent for the clients by taking over the ip of the original machine. If you don't want to allocate a machine for this, than don't bother setting up a hot spare the way you intended any way. To my mind, that's just wasting memory on it.

If your cache requirement is larger than a single machine's memory, you're probably better off with a pool of machines without any hot spare. Memcached's default sharding algorithm will just spread the keys to other memcached daemons from the pool if one goes missing. So you don't really need to have a hot spare ready to take over its share.

Best regards,

Arjen

On 10-7-2011 7:42 ktechie wrote:
I want to setup memached servers with each having a hotspare.
So a memcached server running on a particular ip and port combination
and port will have another memcached
server running on same ip and port.
I tested this on windows xp.
I am able to able multiple memcached processes, but only one is active
at a time.
When the first process is killed, the other one gets active.

However I am unable to open two processes in the same way in linux. It
says the port is already in use.

Is this the correct way to setup hotspare&  if so how do I set it up
in linux machine.

Please advise.

Thanks for the replies

Reply via email to