• Post Reply Bookmark Topic Watch Topic
  • New Topic

Coonection Pooling  RSS feed

 
Shaveta Chawla
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please explain me why do we use Connection pooling and how it is used? i have read several tutorials but couldn't understand it practically.

Thanks
 
subodh gupta
Ranch Hand
Posts: 203
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Through instance pooling what we do is maintain the pool of X number of instances.
Where X is a pool size and depends upon the size of the application and some other factors.

See it is on demand sort thing when you need the instance you take it from the pool and when you done you return the instance back to the pool.

And hence the same intance can be used multiple times.

Now yours is the connection pooling so lets take an example:

you have 15 users accessing the database and making a multiple calls and opening and closing connection on each call. But never more than 5 connection are in use at point of time.

So make the pool of 10 instance which will be used by them interchangeably and saves the lot of call and efficeint maintance of the connection.

Also is the request frequency increases the pool has concept of increasing the pool size by certain number again decided by the nature of application (sat 10).

So when the request of 11 connection will come the pool size will be increamented to 20 and one connection is returned to the request.

If i missed out on anything or you are still not clear please revert back.
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The point of all that is

a) Share a small number of connections among a large number of users. Connections eat up resources on both ends, so fewer is better. Back in the days of VB or PowerBuilder client apps on every user's desktop, we often had a connection (or more) per user. Now we can get by with a handful.

b) Reuse a connection over and over instead of many connect, use, and disconnect cycles. Connect is relatively slow so this is a performance help.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!