很多用户是有不同的用户名和密码的 那么它们应该不属于一个persistent connection 如果不mysql_close的话,虚拟主机提供商 是不是就会出现那种情况阿 我想是那样的 如下也是一段解释 Be careful using mysql_pconnect. If you are hosting on an ISP, they may frown upon you using multiple persistant mysql connections as this consumes resources for a longer period of time. If your script crashes, your connection can stay open for long periods of time. If there is a loop involved, you could accidently eat up all the available connections. That might be considered abuse by an ISP and you could get in trouble. Try using mysql_connect first instead. 90% of the time, a non-persistant mysql_connect call will do the trick just fine.
我用'netstat -anp'看到很多TIME_WAIT的connections, 这是合故?
如下也是一段解释
Be careful using mysql_pconnect. If you are hosting on an ISP, they may frown upon you using multiple persistant mysql connections as this consumes resources for a longer period of time. If your script crashes, your connection can stay open for long periods of time. If there is a loop involved, you could accidently eat up all the available connections. That might be considered abuse by an ISP and you could get in trouble. Try using mysql_connect first instead. 90% of the time, a non-persistant mysql_connect call will do the trick just fine.
同一个网站是可以共享persistent connection的, 因为多数情况都是同一个用户连同一个数据库, 而host通常是localhost.
我还不知道怎么关掉存在的persistent connect, 不知道serveice mysqld restart可不可以.