Hi Brian, Thank You so much for the reply.
I haven't used persistent connections, as i haven't explored it and don't know how much it will impact performance or will it arise any dependencies like memory,cpu etc. I have seen my code, and previously i haven't closed memcache connections explicitly. So, i have modified code to close memcache connection after my set/get operations. Now , flippping gets minimized to great extent. But i have to be assured that it won't happen. As far as, connections are concerned those are configured at decent value, i.e. much more than it will use at any moment. But, when i checked stats, current connections were very less almost 20-25% of what i have configured, for a instance. Also, there is no Firewall in between. I am using stable version of PHP library. Do Beta version have some nice features? is it safe to use beta version? Thanks again. Regards, Sagar Sonawane On Jan 22, 10:27 pm, Brian Moon <[email protected]> wrote: > First, use persistent connections. I have seen two predominant things > cause that type of behavior. > > 1. You just don't have enough connections available in the memcached > daemons config. Math gets confusing here if you have variable apache > processes. Your connection limit in memcached needs MaxClients * > servers + 10% based on my experience. Connections in LOCK_WAIT and > other closing states can cause more than expected connections. We are > talking about milliseconds, but it happens. > > 2. A firewall somewhere is limiting your connections. > > Also, there are two PHP libraries and one of those has a stable and beta > branch. Which exact version are you using? > > Brian. > --------http://brian.moonspot.net/ > > On 1/22/10 9:31 AM, nEosAg 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
