EVENT_LOG_CHANNEL_CAPACITY

Constant EVENT_LOG_CHANNEL_CAPACITY 

Source
pub const EVENT_LOG_CHANNEL_CAPACITY: usize = 1024;
Expand description

Bounded channel depth for event-log entries between the reducer applier and the writer task.

Sizing rationale (v0.2 homelab scale):

  • ~256-host fleet, ~10 events per host during peak rollout activation, ⇒ peak burst ~2 560 entries; sustained rate is much lower.
  • SQLite + WAL sustained insert rate is ~10 k/s on stock SSDs, so draining 2 560 entries is < 300 ms.
  • Half of peak burst is comfortable headroom without making the writer queue itself a memory sink during steady state. 1 024 entries × ~256 bytes/entry ≈ 256 KiB tail latency budget.
  • Backpressure surfaces at the reducer (its send().await waits), which is the desired behaviour: the audit log must not lose entries.