#[non_exhaustive]pub struct RuntimeOptions {Show 13 fields
pub io_engine: IoEngineOptions,
pub io_mode: IoMode,
pub read_admission: ReadAdmission,
pub reclaim_io_timeout: Duration,
pub io_recovery_timeout: Option<Duration>,
pub fill_control: FillControlOptions,
pub append_shards: u32,
pub l1_capacity_bytes: usize,
pub l1_eviction_policy: L1EvictionPolicy,
pub managed_memory_limit_bytes: usize,
pub l1_shards: usize,
pub write_flush_threshold_bytes: usize,
pub stats: StatsOptions,
}Expand description
Process-local runtime configuration checked together by CacheConfig::new.
These options may change across opens. Warm recovery rebinds append shards
from recovered Active and Free Regions when the requested topology fits.
Start with Self::default and assign the fields to customize.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.io_engine: IoEngineOptionsIndependent read, write, and reclaim pools (defaults to POSIX with 4, 4, and 1 workers).
io_mode: IoModeRecord I/O mode (defaults to buffered; direct I/O requires supported Linux storage).
read_admission: ReadAdmissionAdmission policy after an L2 candidate has been selected.
reclaim_io_timeout: DurationDeadline for each background reclaim read, including I/O admission.
Defaults to five seconds. Must be positive and representable as an
absolute deadline. Does not change foreground reads or writes. Longer
deadlines can delay shutdown and exhaust free Regions while waiting;
expiration enters io_recovery_timeout recovery before cancellation
can fail the cache instance.
io_recovery_timeout: Option<Duration>Background timeout recovery budget after the normal admission/completion deadline.
Defaults to None (recover until completion or close). Use
Some(Duration::ZERO) for immediate cancellation, or a finite duration
to limit recovery. While recovering, new fills return overload while
existing reads and deletes remain available; original requests retain
their slots, buffers, and Regions and are never resubmitted. Close
interrupts recovery, whereas drain can wait indefinitely with None.
Actual I/O errors and invalid completions still fail the instance.
fill_control: FillControlOptionsOptional pre-timeout fill pressure control.
Disabled by default. Enabled modes reserve bounded worker observations;
Adaptive paces background flush and pauses new fills when outstanding
work is old.
append_shards: u32Hash-routed append paths, from 1 through 256 (default 4).
Each shard needs one Active Region, two Region-sized buffers, and a worker; the layout also needs one spare Region.
l1_capacity_bytes: usizeRetained L1 byte budget, including keys, values, and ownership charges.
Defaults to 256 MiB; zero disables L1. Fixed L1 metadata is charged separately.
l1_eviction_policy: L1EvictionPolicyBounded L1 eviction policy (defaults to CLOCK; S3-FIFO adds ghost metadata).
managed_memory_limit_bytes: usizeAggregate cache-managed memory limit, defaulting to 1 GiB.
Covers index mappings, L1, buffers, metadata, queues, and cache threads. Allocator overhead, Tokio, application memory, and the kernel page cache are outside it.
l1_shards: usizeIndependently locked L1 shards, from 1 through 65536 (default 32).
Powers of two give the cheapest routing; more shards require more metadata.
write_flush_threshold_bytes: usizePer-append-shard threshold for requesting a flush, in 4 KiB multiples through 4 MiB (the default).
Partial buffers also flush on a bounded delay, pressure, and completion barriers.
stats: StatsOptionsActivity counters, request outcomes, and latency distributions.
Defaults disable collection; health and resource gauges remain available.