When users access the site, to get data it tries to connect to memcache. I check if I am getting an error value back while connecting. That is when I get this error message. However, as soon as I get this error, I immediately go and check if the process is up and everytime its up and working fine.Is this a problem with memcache.default_timeout_ms ? its set to 1000 by default. do I need to bump it up? if so, how to do that? I have iptables turned off on the server that is running memcached server. Also its a persistent memcache by default. I think what might be happening is that though the memcached server is up and running at times the servers are not able to connect, maybe cause it timesout before it gets data back?Any help or pointers would be highly appreciatedSnehal
In my PHP code I am using the correct port number as shown below:$mResult = $this->cache->connect($my_ip,"11234");
On Sun, 11 Jul 2010, Snehal Shinde wrote:
> Yes Jay is right. My server and client config are in sync. The problem
> is only intermittent and so i felt maybe increasing the default
> timeout might help. Any idea how i can increase the default memcache
> timeout for the php client Memcache?
I forget offhand :/ if it's not listed in pecl.php.net/memcache then
you're a little SOL.
Are you on version 3.x or version 2.x? (I might've missed this from
earlier in the thread). I've heard rumors of random connect failures in
3.x.
Also, your network might be experiencing a really low rate of packet loss.
If you can change the timeout, set it to 2 seconds for a while.. if you
still get random timeouts, set it to 4 seconds (higher than the SYN
retry). If it never fails or almost never fails at 4 seconds then you have
some packet loss that might be fixable.
It should never take memcached longer than a few ms to set up a new
connection, so anything worse than that usually means the box is hosed
(swapping) or the network is hosed (maxed, packet loss, etc).
> I am using the stable 2.x one. I have set the timeout to 3 secs now. Lets see how that goes
> Snehal
You might want to stick with 2 or 4 seconds to test :) putting it right on
the line with the SYN timeout will still give you inconsistent results...
top posting.
If you can, I'd recommend writing a commandline php nugget and run it in a
loop reconnecting over and over. Run that under strace and log to file, so
you can see what syscall was returning (RST, timeout, etc).
running memcahced in -vv or -vvv mode will create an intense amount of
logging.