tags:

views:

20

answers:

1

I have a php function ( "mconnect") for connecting to mysql . Sometimes in full load i get a blank page with "[]mconnect: mysql_connect"
In this function i have custom messages for mysql error 1040 and 2002 -- connection errors
In logs nothing appears when this error occur
I use lighttpd 1.4.28 with php-cgi 5.2.0 and mysql 5.0.32 debian etch

Those blank pages with error appears only in full load : when mysql has Avg. questions per second = 586.39 and lighty ~300 conn/s
Both, lighty and mysql share the same machine: dual quad xeon with 8G ram

If anyone has a clue, please share

Thanks
Cris

A: 

You could increase MySQLs connection limit, like pointed out in this article: http://rackerhacker.com/2007/01/24/increase-mysql-connection-limit/

But it would be good if you also had a look over different performance tunning like query caching and the like. As well information I have found on the same website. http://rackerhacker.com/2008/06/24/mysql-error-1040-too-many-connections/

But the best approach would be to limit the number of database accesses from your application, have some caching in place and do the minimal connections to your database.

mhitza
Connection limit is very high , and i use querry cache. Is a production server with many writes. Error 1040 or 2002 has a custom error mesage in our application, when occur. This error i don't know what it is..this is my question
cris
Possibly related http://stackoverflow.com/questions/2996976/are-mysql-close-and-pg-close-required
mhitza
I don't think, because php-cgi close connection immediate on script finish
cris