Adjust pool defaults for many core systems with undetected topologies.

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk
2026-01-19 19:26:30 +00:00
parent 04dc0fda60
commit 3e1246984c
5 changed files with 16 additions and 6 deletions

View File

@@ -1987,8 +1987,7 @@ pub struct Config {
/// Sets the number of worker threads in the frontend-pool of the database.
/// This number should reflect the I/O capabilities of the system,
/// such as the queue-depth or the number of simultaneous requests in
/// flight. Defaults to 32 or four times the number of CPU cores, whichever
/// is greater.
/// flight. Defaults to 32 times the number of CPU cores.
///
/// Note: This value is only used if db_pool_affinity is disabled or not
/// detected on the system, otherwise it is determined automatically.

View File

@@ -69,7 +69,8 @@ pub(super) fn configure(server: &Arc<Server>) -> (Vec<usize>, Vec<usize>, Vec<us
// The default worker count is masked-on if we didn't find better information.
let default_worker_count = topology_detected
.is_false()
.then_some(config.db_pool_workers);
.then_some(config.db_pool_workers)
.map(|workers| workers.saturating_mul(num_cores));
// Sum the total number of possible tags. When no hardware detected this will
// default to the default_worker_count. Note well that the thread-worker model