473,395 Members | 1,689 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Connection pooling in PHP?

Hi,

Is that when using pconnect to mysql, it is already mean connection
pooling?

thanks.

Sep 28 '06 #1
3 2161
ho******@gmail.com wrote:
Hi,

Is that when using pconnect to mysql, it is already mean connection
pooling?

thanks.
No. mysql_pconnect() is a persistent connection. These connections
will be around as long as your web server is running and can be reused
by different scripts. The number of connections is fixed.

Pooling allows connections to be reused also. But the difference is
smart pooling will dynamically adjust the size of the pool. For
instance, if a connect request is issued and there is a free connection,
that one is used. If none are free, a new one is acquired.

When a the application closes a connection, the connection isn't
released immediately. Instead, it can hang around for a while.
Eventually unused connections will be released.

Of course, this assumes one server and one userid/password. It's a
little more complex if you use more than one server and/or
userid/password, but the concept is the same.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Sep 28 '06 #2

Jerry Stuckle 寫道:
ho******@gmail.com wrote:
Hi,

Is that when using pconnect to mysql, it is already mean connection
pooling?

thanks.

No. mysql_pconnect() is a persistent connection. These connections
will be around as long as your web server is running and can be reused
by different scripts. The number of connections is fixed.

Pooling allows connections to be reused also. But the difference is
smart pooling will dynamically adjust the size of the pool. For
instance, if a connect request is issued and there is a free connection,
that one is used. If none are free, a new one is acquired.

When a the application closes a connection, the connection isn't
released immediately. Instead, it can hang around for a while.
Eventually unused connections will be released.

Of course, this assumes one server and one userid/password. It's a
little more complex if you use more than one server and/or
userid/password, but the concept is the same.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
sorry first... my google account has some problem, which can't find my
posted article and thus I repost it today.

back to the topic...
currently which package/solutions is the most popular one for php
connection pooling?

Sep 29 '06 #3
ho******@gmail.com wrote:
Jerry Stuckle 寫道:

>>ho******@gmail.com wrote:
>>>Hi,

Is that when using pconnect to mysql, it is already mean connection
pooling?

thanks.

No. mysql_pconnect() is a persistent connection. These connections
will be around as long as your web server is running and can be reused
by different scripts. The number of connections is fixed.

Pooling allows connections to be reused also. But the difference is
smart pooling will dynamically adjust the size of the pool. For
instance, if a connect request is issued and there is a free connection,
that one is used. If none are free, a new one is acquired.

When a the application closes a connection, the connection isn't
released immediately. Instead, it can hang around for a while.
Eventually unused connections will be released.

Of course, this assumes one server and one userid/password. It's a
little more complex if you use more than one server and/or
userid/password, but the concept is the same.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================


sorry first... my google account has some problem, which can't find my
posted article and thus I repost it today.

back to the topic...
currently which package/solutions is the most popular one for php
connection pooling?
There really isn't one.

Is there a problem you're trying to solve with the pooling? How do you
know this is the problem?
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Sep 30 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Mithun Verma | last post by:
Hello All, I am working on a windows application which will talk to the database through the Web services. So i need to enhaance the performance, for which i m using connection
5
by: John | last post by:
Does COM.ibm.db2.jdbc.DB2DataSource, (which supports connection pooling) need to be run within a J2EE container environment before the connection pooling facility is actually available to a user? ...
18
by: Rob Nicholson | last post by:
We're getting an occasional occurrence of the following error when two users try and open the same record in our ASP.NET app: "There is already an open DataReader associated with this Connection...
1
by: Lenny Shprekher | last post by:
Hi, I am getting issues that Oracle collecting opened sessions (connections) from my webservice using regular System.Data.OleDb.OleDbConnection object. I am guessing that this is connection...
2
by: JimLad | last post by:
Hi, In an existing ASP/ASP.NET 1.1 app running on IIS 6, I need to RELIABLY pass the logged in username through to the SQL Server 2000 database for auditing purposes. The current method is...
16
by: crbd98 | last post by:
Hello All, Some time ago, I implemented a data access layer that included a simple connectin pool. At the time, I did it all by myself: I created N connections, each connection associated with...
20
by: fniles | last post by:
I am using VS2003 and connecting to MS Access database. When using a connection pooling (every time I open the OLEDBCONNECTION I use the exact matching connection string), 1. how can I know how...
3
by: fniles | last post by:
In the Windows application (using VB.NET 2005) I use connection pooling like the following: In the main form load I open a connection using a connection string that I stored in a global variable...
0
viswarajan
by: viswarajan | last post by:
Introduction This article is to go in deep in dome key features in the ADO.NET 2 which was shipped with VS 2005. In this article I will go trough one of the key features which is the Connection...
15
by: Sylvie | last post by:
I have a static function in a class, everytime I call this function, I am creating a SQLconnection, open it, use it, and null it, All my functions and application logic is like this, Every...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.