Re: question - support
| From: | Jason Sheets | Date: | Fri, 02 May 2003 17:58:37 +0000 |
| Subject: | Re: question - support | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-146164@lists.php.net to get a copy of this message | ||
Hello,
You could be running out of connections to the MySQL database server, if you have access to restart MySQL you might consider changing the configuration so that it allows more concurrent connections.
Your description is interesting, are you using persistent connections? If you are just using mysql_connect the server should free the connection at the end of the result, so if you are using mysql_connect and the connections are being reset at the end your peak load is probably higher than the number of connections MySQL is accepting. If you are using persistent connections you may consider turning them off (you will take somewhat of a performance hit but it will result in more mysql connections being available).
You can code around the issue somewhat by making sure you don't connect to the database unless you are going to need the database connection and using mysql_close when you are done with the connection, since PHP closes the connection for you at the end of script execution that is really only of benefit when you need to pull information from the database and the processing takes some time and you want to free the connection.
Bottom line take a look at your MySQL server configuration, you shouldn't be needing to restart it every couple thousand visits.
Jason
Fabricio orerreuG wrote:
i was going to ask the question in the notes part of the site but i saw your comments of it so here it is. this my error Warning: Supplied argument is not a valid MySQL-Link resource in ..... it seems to be that my site is generating more visits which my server can handle. and everytime i pass a couple of thousand of visits a day i get this error. and the only way of fixing it is restarting the mysql daemon. my question is there anyway i can restart this daemon via php so i wont have to keep on doing this manually? please help.