> I've been trying to find resources online to address a few questions i
> had regarding the various configuration options available with
> Memcached client/server without much success.

The wiki at http://memcached.org/wiki has most of this, though perhaps not
in the most clear way. The old FAQ has a good chunk of it as well. Perhaps
it's a little "read between the lines", but most things you don't want to
do have warnings.

> Heres how my setup would look like
> i'd have two web servers [amazon EC2 instances] load balancing
> incoming requests in a round robin fashion - each of these web servers
> would have memcached[client and server] installed in it
>
> Now it would be great if somebody could give me pointers on the below
> questions.
>
> #1) Should i use consistent hashing.
> I am not expecting instances to go down randomly. But whenever one
> machine has to be taken out for maintenance etc, would like to
> minimize the impact. i read about a reduced performance when switched
> to consistent hashing. Not sure whether it is still valid.

Yes.

> #2 ) If we are using standard vs consistent hashing how would failover
> work?
> I see that pecl/memcache has a failover flag but can't find anything
> similar to it in pecl/memcached. What are the implications.

Hashing doesn't change how failover works. It's generally a better idea to
let it fail if it dies, then have enough servers to cope. Otherwise if
servers flap you'll end up with an inconsistent cache or even more cache
misses.

So a failed server == extra cache misses based on how many servers you
had. Adding servers, removing servers, with consistent hashing causes the
same thing. Vs it being far worse.

> #3) Should i always go with persistent connections?

If you can yes. Be careful as some clients don't present a reusable
connection very well and you can end up leaking connections. You should
try to use persistent conns, then fail back to non persistent if they
don't work.

enjoy.
-Dormando

Reply via email to