Re: Why use persistent connections? || Data driven site
| From: | John Taylor-Johnston | Date: | Sun, 23 Feb 2003 08:50:20 +0000 |
| Subject: | Re: Why use persistent connections? || Data driven site | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-136710@lists.php.net to get a copy of this message | ||
I stopped using pconnect. Don't see the sense in it. Why take the chance?
http://www.php.net/manual/en/function.mysql-pconnect.php
<blockquote>Warning
Using persistent connections can require a bit of tuning of your
Apache and MySQL configurations to ensure that you do not exceed
the number of connections allowed by MySQL.</blockquote>
Search also for "consistency" and read that note.
Begin using:
http://www.php.net/manual/en/function.mysql-connect.php
I had real trouble with this on a Windows server once. I stopped using pconnect. Too many
connections. Crashed my server more than once.
# $link = mysql_pconnect($MyHost,$MyAccount,$MyPass);
$link = mysql_connect($MyHost,$MyAccount,$MyPass);
...
mysql_close($link);
> Should we be using persistent connections, or are we better off opening and closing connections
> on each query?