Replace hardcoded pool worker limit with configurable default.
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
@@ -65,8 +65,8 @@ pub(crate) type BatchQuery<'a> = SmallVec<[KeyBuf; BATCH_INLINE]>;
|
||||
pub(crate) type BatchResult<'a> = SmallVec<[ResultHandle<'a>; BATCH_INLINE]>;
|
||||
pub(crate) type ResultHandle<'a> = Result<Handle<'a>>;
|
||||
|
||||
const WORKER_LIMIT: (usize, usize) = (1, 1024);
|
||||
const QUEUE_LIMIT: (usize, usize) = (1, 4096);
|
||||
const WORKER_LIMIT: (usize, usize) = (1, 4096);
|
||||
const QUEUE_LIMIT: (usize, usize) = (1, 1024);
|
||||
const BATCH_INLINE: usize = 1;
|
||||
|
||||
const WORKER_STACK_SIZE: usize = 1_048_576;
|
||||
|
||||
@@ -124,6 +124,7 @@ pub(super) fn configure(server: &Arc<Server>) -> (Vec<usize>, Vec<usize>, Vec<us
|
||||
.filter_map(|mq| mq.nr_tags)
|
||||
.chain(default_worker_count.into_iter())
|
||||
.fold(0_usize, usize::saturating_add)
|
||||
.min(config.db_pool_max_workers)
|
||||
.clamp(WORKER_LIMIT.0, WORKER_LIMIT.1);
|
||||
|
||||
// Tamper for the total number of workers by reducing the count for each group.
|
||||
|
||||
Reference in New Issue
Block a user