HikariCP Connection Pool Sizing Formula for PostgreSQL & MySQL
Oversized JDBC pools cause context-switching storms on the database server. A pool sized around (core_count * 2) + effective_spindle_count consistently delivers higher throughput and lower p99 latency.
Read also: SQL composite index ordering.