pub struct ShardedWritePoolConfig {
pub shards: usize,
pub per_shard_buffer: usize,
pub write_loop: WriteLoopConfig,
}Expand description
Tunables for run_sharded_write_pool.
shards = 1 is the legacy single-worker layout and incurs no
dispatcher overhead. shards > 1 spawns a dispatcher that hashes
each sample’s pv_name to a fixed shard (so any one PV’s samples
always land in the same per-shard write_loop, preserving
timestamp ordering) and N parallel shard workers — different PVs
can append concurrently instead of queueing behind a single task.
Sites with many active PVs and a fast STS should set this to
min(num_cpus, expected concurrent slow appends).
Fields§
§shards: usizeNumber of parallel shard workers. Must be ≥ 1; 1 is the
degenerate case (no dispatcher, behaves identically to a
bare write_loop_with_config).
per_shard_buffer: usizempsc capacity of each shard’s input channel. The dispatcher
try_sends into this; when full, the OFFENDING SHARD’s
drop is recorded under
archiver_dispatcher_shard_overflow_drops_total{shard=N}
and the sample’s per-PV buffer_overflow_drops counter is
bumped. Other shards keep flowing — that’s the per-shard
isolation guarantee.
write_loop: WriteLoopConfigPer-worker config (timeouts, flush period). Cloned into each shard.
Trait Implementations§
Source§impl Clone for ShardedWritePoolConfig
impl Clone for ShardedWritePoolConfig
Source§fn clone(&self) -> ShardedWritePoolConfig
fn clone(&self) -> ShardedWritePoolConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more