Why are you using the pseudo-lock operations around the set?  Memcached is
itself atomic, in that no two sets can corrupt each other and get is always
guaranteed to return exactly what was set.

Plus, if you want to do locking, I'd recommend doing it with CAS instead.

50 clients should be no problem at all for 8 servers.  Are you using some
sort of connection pooling?  It sounds like you probably have a lot of
unused connections hanging around or something.  I believe in PHP this is
called "persistent connections."

Also, if you do a stats on the servers, how many connections do they think
that they have?  And how many were they configured to handle?

On Fri, Jan 22, 2010 at 10:31 AM, nEosAg <[email protected]> wrote:

> I have 8 memcache instances running and used default hashing policy
> with failover set to False.
>
> So, after lots of monitoring i came to know that some of my memcache
> instances gets down/ connection refused to client.
>
> I m using PHP client Library.
>
> At times, when i checked Stats for servers then there were few
> thousand connections. Then i changed my code to make connection when i
> need to SET or GET any Key and after the operation close the
> connection.
>
> My Approach is Get LOCK (pseudo like adding key with lock prefix) on
> Key then SET data then delete LOCK key.
>
> Then, it minimized close to no flapping. But still there is another
> problem.
> Now, i wanted to knwo the status of the server before doing any GET /
> SET operation as there are almost 50-100 concurrent(users) hits to
> Cache so obviously there will be Data Integrity issues. So to
> implement atomicity i need to know if Server is up and running then
> only perform update Cahe operation otherwise do nothing to cache.
>
> I have gone in infinite loop might over thinking it!! But as per my
> requirement i need 100% consistency in Real Time :)
>
> Please help me or guide me if my approach is wrong.
>
>
> Regards,
> Sagar
>



-- 
awl

Reply via email to