Skip to main content

configure

Function configure 

Source
pub(super) fn configure(
    server: &Arc<Server>,
) -> (Vec<usize>, Vec<usize>, Vec<usize>)
Expand description

Determine storage hardware capabilities of the system for configuring the shape of the database frontend threadpool.

Returns a tuple of:

  • topology Vector mapping hardware cores to hardware queues. Systems with fewer queues than cores will see queue ID’s repeated. Systems with the same or more queues as cores will usually see a 1:1 association of core ID’s to queue ID’s. Systems with sparse core assignments will see 0 for core ID positions not available to the process. Systems where detection failed will see a default of 1:1 core identity as a best-guess maintaining core locality.
  • workers Vector mapping hardware queues to the number of threads to spawn in service of that queue. Systems with fewer queues than cores will set an affinity mask for each thread to multiple cores based on the topology. Systems with equal or more hardware queues than cores will set a single affinity for each thread.
  • queues Vector of software mpmc queues to create and the size of each queue. Each indice is associated with a thread-pool of workers which it feeds requests from various tokio tasks. When this queue reaches capacity the tokio task must yield.