Yii 1.1.15 - memcached fail with two node if one is down


I’m using Yii 1.1.15 and php memcached 2.0.7 (not memcache) configured with two nodes as follows:



		'useMemcached' => true,


		array('host'=>'', 'port'=>11211, 'weight'=>50),

		array('host'=>'', 'port'=>11211, 'weight'=>50),



Both node are working from a application view, both are accepting connects from my application server (when I configure only one). When I take one node down for simulating some memcached crash, it seems the other node does not exists from Yii’s perspective (just when configured as single node). What am I doing wrong?


Did another test this time against pecl php memcache Version 2.2.7 instead of php memcached and it could handle two nodes as well one of the down.

Would say memcached version 2.0.1 has bug or Yii when it should handle more than one node and one of them failing.


Assume a Yii bug as I get the exception that one node is down with memcache but not when using memcached php extension.

Shouldn’t that be prevented by Yii to turn my application down:

<h1>PHP Error [8]</h1>

<p>Memcache::get(): Server (tcp 11211) failed with: Connection refused (111)</p>

I get randomly on some requests 500 Internal Server Error as Yii can’t work with Memcached nodes which are down…


Ok solved the problem which is related to the retry interval when occasionally the server connection fails again.

Solution found here:


" retry_interval

Controls how often a failed server will be retried, the default value is 15 seconds. Setting this parameter to -1 disables automatic retry. "

Now my configuration looks like:


   array('host'=>'', 'port'=>11211, 'weight'=>90, 'status' => true, 'retryInterval' => -1),

   array('host'=>'', 'port'=>11211, 'weight'=>10, 'status' => true, 'retryInterval' => -1),


I’ve set status and retryInterval. So case almost closed…Yii should catch those retry connection error which leeds to 500 server errors…