List:General Discussion« Previous MessageNext Message »
From:Jacques Marneweck Date:December 1 2006 12:12pm
Subject:Re: mysql_pconnect() made things worse
View as plain text  
Brian Dunning wrote:
> I have many sites accessing one MySQL server, all using the same IP, 
> username, password via a PHP $connection = 
> mysql_connect($ip,$user,$pass);.
> The server is extremely busy, hammered 24x7, but almost all traffic is 
> coming from one very short script. About once a day we're getting "No 
> database selected" with that one table "busy" and the only way out is 
> mysqladmin flush-hosts.
> In that one busy script, I replaced mysql_connect() with 
> mysql_pconnect() according to some advice I received, and the server 
> immediately went back to "No database selected" and all hung up.
> Everything I read seemed to indicate that what I did should have made 
> things better, not worse. Can someone suggest what my next steps 
> should be?
Check your max_connections setting which shows how many connections your 
server will allow at any time:

SHOW VARIABLES LIKE '%connections%';

And checking status:

SHOW STATUS LIKE '%connections%';

Will tell you how many connections you've used simultaneously.


Jacques Marneweck

#include <std/disclaimer.h>

mysql_pconnect() made things worseBrian Dunning1 Dec
  • Re: mysql_pconnect() made things worseJacques Marneweck1 Dec