There has been a MySQL connection problem on our server. The strange factor is this fact problem only happens every now and then, possibly 1 from 100 occasions, also it appears it takes place more often when there's heavy strain on our servers. Before, whenever we had a smaller amount customers, we'd never check this out error.
The mistake originates from this type of code:
$myconnection = mysql_pconnect($hostname_myconnection, $username_myconnection, $password_myconnection) or trigger_error(mysql_error(),E_USER_ERROR);
and also the error that is tossed is:
Warning: mysql_pconnect() [function.mysql-pconnect]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (11) in/home/john/web/htdocs/lib/myconnection.php on line 11
Within the same file we establish another MySQL connection, which is dependant on Zend Db Adapter:
$db = new Zend_Db_Adapter_Mysqli($data);
We use both two connections.
My real question is: where performs this error originate from? Can the mistake be triggered because so many people are attempting to begin a connection simultaneously? If this sounds like the situation, what's the establishing httpd.conf or my.cnf that people should change? Or perhaps is it an issue that people are creating two connections per user?
I see you are using persistent connections which means this should not be any problem whatsoever. I suspect your PHP wasn't put together with persistent connections, and
mysql_connect is contacted the backdrop rather than its persistent cousin.
All systems possess a limit on open electrical sockets and files, if you're instantiating many connections throughout page load and also the persistent function isn't working both find a new socket.
Opt for closing the connections by hand, as PHP scripts can operate a couple of seconds despite the customer hit the cancel button, and cleanup (closing the bond) could require sometime by doing this.