Not that I'm familiar with the PHP client, but if it's the same as in most
others, then you can put whatever you want in there, and all gets and sets
that have the same $server_key are guaranteed to end up on the same server
every time. Exactly which server is not something you need to know.

The purpose of this function is to consolidate items that you often
multi-get onto the same server, so that when you get them, you can do it in
one operation hitting only one server. For example, say that you have three
different user objects for a single user. When you set them individually,
you use their user id as $server_key, and when you want to get all three
objects, you simply do a getMultiByKey with the user id as $server_key.


/Henrik Schröder

On Fri, Oct 30, 2009 at 05:36, nard <[email protected]> wrote:

>
> Hello. I'm starting to use the getByKey/setByKey api for memcached and
> I was wondering how the server_keys determined? I'm having trouble
> figuring out how a server key is mapped to a particular server in a
> memcache pool.
>
> is there a way to find out what the server_key is for a particular
> memcached server in the pool?
>
> can someone help me out here?
>
> Thanks
> -vince
>

Reply via email to