Re: [PHP4BETA] Database Connection Pooling
| From: | Manuel Lemos | Date: | Thu, 02 Mar 2000 07:37:12 +0000 |
| Subject: | Re: [PHP4BETA] Database Connection Pooling | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-11317@lists.php.net to get a copy of this message | ||
Hello Cary,
On 01-Mar-00 17:47:55, you wrote:
>> >> AFAIK all supported databases have functions to establish persistent
>> >> connections. They work on a per server process basis. That means
>> >> persistent connections are kept until a server process lives, and
>> >> each server process manages their own pool of persistent connections.
>>
>> >Assumption is the mother of all screw-ups. While PHP does support
>> >persistent connections, those are per Apache process. What it needs is
>> >a common connection pool for all Apache processes.
>>
>> If that is what it was meant, I don't think it is a good idea. One
>> persistent connection per process is better than have Apache processes
>> competing for database connections allocated from a common pool. The way I
>> see it, that would impose needless latency in database connections.
>>
>I don't see why you would think that a connection per process is better.
Speedwise. Allocating a connection from a pool rather than establishing
it on demand, puts the process on hold in the connection request pool
queue.
>Except for the case where EVERY hit requires a DB connection for handling
>of the request, you will always have extra, resource consuming connections.
Not every hit, only the first hit for each process that requests a DB
connection. I am thinking of PHP running as Apache module.
Regards,
Manuel Lemos
Web Programming Components using PHP Classes.
Look at: http://phpclasses.UpperDesign.com/?user=mlemos@acm.org
--
E-mail: mlemos@acm.org
URL: http://www.mlemos.e-na.net/
PGP key: http://www.mlemos.e-na.net/ManuelLemos.pgp
--