具体bug说明参见 https://bugs.php.net/bug.php?id=60460
引用
Memcache::addServer() does a *presistent* connection by default, if you do not
specify it to be different.
memcache::close() function doesn't close persistent connections, which are closed
only during web-server shutdown/restart.
so this is not a bug at all, but a coding error.
亦即问题是错误的使用Memcache::addServer所致。调用addserver时,如果设置persistent为true,则此链接将不会关闭,直至web server重启;即使显示调用close也没用。而php为短执行进程,执行完毕退出后新执行脚本又发起addServer的新链接,从而导致链接数不停增加。
使用Memcache::connect则不会出现此问题,其实也就是persistent=false的形式。
对应的还可以参考
引用
Memcache::pconnect()is similar to Memcache::connect() with the difference, that the connection it establishes is persistent. This connection is not closed after the end of script execution and by Memcache::close() function.
也是长连接