"OneSolution" <on*********@sbcglobal.net> wrote in message news:ctnlc.6227
I found out that the above pconnect() function will pool connections.
Where is this function. I cannot find the string "pconnect" in all of my
c:\mysql\include, and I have version 4.1.
So how do you use it properly? There's another post in this list stating
that the user got connection refused error messages.
Also, is there a real performance increase due to connection pooling with
MySQL in PHP?
Don't know about your exact question, but have a response for a similar
setup on C++. I do the connection pooling on the C++ side (which is
probably slightly faster than doing the pooling on the MySql Server side) --
there is a class Database which has an array of used and unused connections,
and when a Select object needs a connection it requests one from Database,
which looks in its array of unused connections for one, and if it doesn't
find one creates a new ActualConnection with mysql_real_connect, and the
destructor of ActualConnection calls myql_close to close the connection, and
the destructor of Select gives its connection back to the databasee.
My test program was to select last_name and first_name from contact N=3000
times, and to iterate through all the rows and count the number of columns
in each row. First run is with the connection pooling as described above,
and second run is with no connection pooling which is accomplished by
calling the function database.close_unused_connections().
The connection pooling method took 3562 milliseconds, and the non connection
pooling method took 21781 milliseconds.
In my test we connect to localhost. The times would be longer if we
connected to a remotehost.
My setup is Borland C++ Builder version 6, Windows ME with 128 MB RAM, MySql
version 4.1, and an AMD 1 GHz processor.