Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Thinking behind decision of database connection pool size

Tags:

i am working on opensource java based application i.e xwiki. Insie hibernate.cfg.xml i can see value of parametrs connection.pool_size and statement_cache.siz as 2(for each). My application will be having maximum load of 100 users at point of time. Now my question is what should be ideal connection pool size for this. To me size 2 looks very less. If 100 users connect at a time 98 users have to wait for grtting the connection released? Should i keep the connection pool size as 100 in my case?

i am using microsoft sql server.

Apart from this is there a limit on max connection pool size. Does it depend on webserver(tomcat in my case) or datastore vendor(ms sql server)?

like image 499
M Sach Avatar asked Jan 06 '12 04:01

M Sach


People also ask

How do I know what size connection pool to get?

For optimal performance, use a pool with eight to 16 connections per node. For example, if you have four nodes configured, then the steady-pool size must be set to 32 and the maximum pool size must be 64.

What is meant by pool size in database?

A connection pool maintains a specific number of open database connections to an application in the main memory. The default size of the database connection pool is eight, but you can change this number while deploying or updating an application in the SAP BTP cockpit.

Why do we need database connection pool?

Database connection pooling is a way to reduce the cost of opening and closing connections by maintaining a “pool” of open connections that can be passed from database operation to database operation as needed.


1 Answers

Sizing a connection pool is not a trivial thing to do. You basically need:

  • metrics to investigate the connection usage
  • failover mechanisms for when there is no connection available

FlexyPool aims to aid you in figuring out the right connection pool size.

like image 154
Vlad Mihalcea Avatar answered Oct 20 '22 05:10

Vlad Mihalcea