Search code examples
databaseconnection-poolingpooling

understanding data pooling properties


I was wondering what is maxPoolSize for? what is minPoolSize for?

How do I know which property value to use for my database?

EDITED

I am using Oracle 10g, connecting with Hibernate and bitronix on windows OS.


Solution

  • minPoolSize is the minimum number of database connections being opened all the time, even when none of them are used. maxPoolSize on the other hand represents the maximum number of concurrent connection. Now:

    • Use minPoolSize to always keep few connections opened (even when idle) so that you don't have to wait for establishing a new network connection when request arrives to the system with low load. This is basically a set of connections waiting "for emergency"

    • maxPoolSize is much more important. If the system is under heavy load and some request tries to open maxPoolSize + 1 connection, the connection pool will refuse, in turns causing the whole request to be discarded. On the other hand setting this parameter to to high value shift the bottleneck from your application to the database server, as it has limited capacity.