0

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.

Dejell
  • 13,947
  • 40
  • 146
  • 229

1 Answers1

1

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.

Tomasz Nurkiewicz
  • 334,321
  • 69
  • 703
  • 674
  • thanks. so what do you recommend to put as maxPoolSize for oracle using bitronix? who decides how many connections to be concurrent to db and when to close one? – Dejell Mar 15 '11 at 22:05
  • Well... measure. After exceeding some value you will notice no performance gain or even performance degradation. Also the maximum number of concurrent connections should be correlated to the number of concurrent HTTP connections (assuming we're talking about web application with JDBC connection bound to the request for almost all the time). As for closing the connections: when the application becomes idle, connection pool should take care of idle connections, closing them completely (but leaving at least `minPoolSize`). – Tomasz Nurkiewicz Mar 15 '11 at 22:28