How should I set the connection pool's maximum size?
In production environments, the best maximum pool size depends on the application and the system. A good starting point is to set the maximum pool size equal to the execute thread count. This allows each execute thread to get its own JDBC connection without blocking while waiting for a connection in use by another thread.
Some applications can run with a maximum pool size less than the number of execute threads. This case generally occurs when there is work entering the server that does not ever need a JDBC connection, and the server has lots of threads doing I/O tasks.