Thinking behind decision of database connection pool size

M Sach picture M Sach · Jan 6, 2012 · Viewed 21.5k times · Source

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)?

Answer

Vlad Mihalcea picture Vlad Mihalcea · May 8, 2014

Sizing 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 figuring our the right connection pool size.

You might check the following articles: