其中一条评论说,在
mysqli文档网站上列出
You should always use mysqli_kill()
function before mysqli_close() to
actually close and free up the tcp
socket being used by PHP. Garbage
collection after script execution nor
mysqli_close() do not kill the tcp
socket on their own. The socket would
otherwise remain in ‘wait’ state for
approximately 30 seconds,and any
additional page loads/connection
attempts would only add to the total
number of open tcp connections. This
wait time does not appear to be
configurable via PHP settings.
Also as of this version,mysqli
created links cannot be “deactivated”,
and will continue to accumulate in
process memory until the PHP server or
process is restarted,essentially
making mysqli.max_links = -1 required.
有人可以解释这意味着什么,如果应该设置mysqli.max_links,怎么做,如果我应该使用mysqli_kill();
我没有发现理性,mysql可以通过localhost上的socket连接
Be careful using mysqli::kill before mysqli::close.
Killing the thread before actually closing the connection will leave the connection open! And depending on your max_connections and max_user_connections (by default the same),this could result in a “Max connections reached for ** user” message.
来自:http://www.php.net/manual/en/mysqli.kill.php