admin管理员组文章数量:1432620
The below code snippet will show 2 current connections present even after running the close() function.
$memcache = new Memcache;
$memecache->connect('unix:///var/run/memcached/memcached.sock:0');
$memecache->close();
$currConnections = $memcache->getExtendedStats()["curr_connections"];
echo $currConnections."<br>";
unset($memcache);
$memcache = new Memcache;
$memecache->connect('unix:///var/run/memcached/memcached.sock:0');
$memecache->close();
$currConnections = $memcache->getExtendedStats()["curr_connections"];
echo $currConnections."<br>";
unset($memcache);
memcached.sock actually shows 3 connections if I set a breakpoint before the script ends:
echo stats | nc -U /var/run/memcached/memcached.sock | grep "STAT curr_connections"
STAT curr_connections 3
Why is the close() function not closing them immedietaly as the documentation suggests as I am not using persistent connections?
note: I did attempt to use persistent connections but those wouldn't ever close and I would get n*2, where n were n is the number of times I opened the script.
本文标签: phpMemcache not closing connections with close()Stack Overflow
版权声明:本文标题:php - Memcache not closing connections with close()? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745549178a2662850.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论