Enter your Postgres CPU cores, effective spindle count, and number of application instances to get a recommended total pool size, the per-instance connection limit to configure, and the max_connections your server should allow. The base formula — (cores × 2) + effective spindles — comes from the HikariCP wiki and PostgreSQL performance guidance, where it consistently outperforms larger pools.
The counter-intuitive part: a smaller pool is usually faster. Once you have more active connections than the database can run in parallel, extra connections add context-switching and lock contention rather than throughput. Treat the result as a benchmarking starting point, and if you run many instances (especially serverless), put PgBouncer in front so per-instance pools do not exhaust the server.