Re[2]: connection pooling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



of course I did,
let me tell you how apache and php interact with php as far as I know:

I'm using php set up as a module for apache. so apache handles each
web page request and forwards the request to one of its threads (the
thread count is set up from httpd.conf). the algorythm it uses is
pretty much the same I described before "If there is an idle thread,
hand the request to that thread, else create a new thread"

So, each thread creates a persistent connection to mysql, regardless
of the connections created by the other threads.

Which at the end, comes to 'a persistent connection for every thread'
and this, I don't find very effective.

what I want to do is, get between apache and mysql, and handle every
connection request with a "resource dispenser".

regardless of the thread count, I want my dispenser handles connection
requests in the way apache handles web page requests: "If there is an
idle connection, use it. else create a new connection"

-- 
Finest,
 Mengü                            
mailto:mengus@soursummitz.org


JG> Did you read the manual page?
JG> http://us4.php.net/manual/en/function.mysql-pconnect.php

JG> [quote]First, when connecting, the function would first try to find a
JG> (persistent) link that's already open with the same host, username and
JG> password. If one is found, an identifier for it will be returned instead of
JG> opening a new connection. [/quote]

JG> In practice it might not act like that though, it depends on your server set
JG> up.

>> -----Original Message-----
>> From: Mengü Gülmen [mailto:mengus@soursummitz.org]
>> Sent: Wednesday, May 28, 2003 2:21 PM
>> To: php-db@lists.php.net
>> Subject:  connection pooling
>>
>>
>> Hi there,
>> I've been looking all over the net for connection pooling information
>> about php and mysql but I didn't come across anything.
>>
>> Do you know anything like the connection pooling system of asp?
>> In php, there is the pconnect, persistent connection which, as far as
>> I know does nothing but open a connection and execute all the commands
>> via that connection.
>>
>> What I want is, something that does this: "If there is no existing
>> connection or the existing connection is in use, open another
>> persistent connection. if there is an open connection and it's idle,
>> use that one"
>>
>> If there is nothing that can do this, I'll start to try to write it on
>> my own. And of course, any help would be appreciated :)
>>
>>
>> --
>> Finest,
>> Mengü,
>> mailto:mengus@soursummitz.org
>>
>>
>> --
>> PHP Database Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux