This was causing me to tear my hair out since I listened to the comments posted here.
If you enable persistence, the options you set will persist as well AND certain options if you set them with persistence enabled WILL CLOSE ALL YOUR PERSISTED CONNECTIONS. This is a part of libmemcached that the memcached extensions is built against. You can verify this by running strace.
So this is what you should do:
<?php
$mem = new Memcached($myPoolId);
if(empty($mem->getServerList())) {
$mem->setOption(Memcached::OPT_RECV_TIMEOUT, 1000);
$mem->setOption(Memcached::OPT_SEND_TIMEOUT, 3000);
$mem->setOption(Memcached::OPT_TCP_NODELAY, true);
$mem->setOption(Memcached::OPT_PREFIX_KEY, "md_");
$mem->addServer($myMemcahceIp, $myMemcachePort);
}
?>