Re: DB package - performance question
| From: | Alan Knowles | Date: | Wed, 09 Jul 2008 23:43:25 +0000 |
| Subject: | Re: DB package - performance question | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-50378@lists.php.net to get a copy of this message | ||
PHP, and the DB tend use persistent connections - eg. there is no-reconnection on each apache request, so you should be OK on this. - this is really a pear-general question though.
That said, any database interaction reduces performance (if you have < 100,000 visitor per day this is probably irrelivant). but once you start getting really high loads, or if you are expecting to then you should start considering this.
Regards
Alan
liran tal wrote:
Dear Dev's, I wanted to get a clue about the performance issues with opening/closing a database connections. For a certain PHP page I could go up to running about 10 sql queries which are defined in different functions and so it happens that in each function I open/close the database connection. How does that impact on performance? And another question comes to mind - is it wise to open the database and close just once for each user session/login? (i.e: open it once at the logging successful stage and close it when the user logs out/session is destroyed cause of timeouts) Regards, Liran.