There are two formulas for the Hikari maximumPoolsize given at About-Pool-Sizing. Optimal throughput is calculated as:
pool_size = (core_count * 2) + effective_spindle_count
In our case that would result in (8 * 2) + 4 something close to 20 connections. The other formula calculates the minimum pool size to avoid a deadlock:
pool_size = MaximumThreads * (max_connections_held_by_single_thread - 1) + 1
In our case that looks like this with numbers 200 * ( 3 - 1 ) +1. That would be far from optimal throughput with a connection pool of 401. Im looking for arguments to close this gap. I did not find anything yet, but maybe there is a way to calculate in, the average transaction time, or statistics how many threads need more than one connection to the database to push the connection pool into the direction of the optimal throughput. Any hints are appreciated.