pub struct KvTuning {
pub default_capacity: usize,
pub rehash_load_factor: f32,
pub rehash_batch_size: usize,
pub default_inline_threshold: usize,
pub expiry_reap_budget: usize,
pub expiry_tick_ms: u64,
}Expand description
KV engine tuning (hash table, expiry wheel, slab allocator).
Controls the per-core hash table parameters, incremental rehash behavior, expiry wheel tick rate, and the per-tick reap budget that prevents reactor stalls during mass-expiry events.
Fields§
§default_capacity: usizeDefault initial hash table capacity per collection (number of slots). Should be a power of two. Larger values reduce early rehash churn for collections that will grow quickly. Default: 16384.
rehash_load_factor: f32Hash table load factor threshold that triggers incremental rehash.
When entries / capacity > rehash_load_factor, the table begins
doubling. Range: 0.5–0.9. Default: 0.75 (standard Robin Hood threshold).
rehash_batch_size: usizeNumber of entries rehashed per PUT during incremental rehash. Higher values complete rehash faster but add per-PUT latency. Default: 8.
default_inline_threshold: usizeDefault inline value threshold in bytes. Values at or below this size are stored directly in the hash entry (no pointer chase). Larger values overflow to slab-allocated Binary Tuples. Default: 64.
expiry_reap_budget: usizeMaximum expirations processed per reactor tick (event loop iteration). Prevents mass-expiry events (e.g., 10M keys with identical TTL) from stalling the TPC core. Expired-but-not-yet-reaped keys are invisible to GET (lazy fallback). Default: 1024.
expiry_tick_ms: u64Expiry wheel tick interval in milliseconds. Determines the granularity of TTL expiration. Lower = more precise but more CPU overhead. Default: 1000 (1 second).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for KvTuning
impl<'de> Deserialize<'de> for KvTuning
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for KvTuning
impl RefUnwindSafe for KvTuning
impl Send for KvTuning
impl Sync for KvTuning
impl Unpin for KvTuning
impl UnsafeUnpin for KvTuning
impl UnwindSafe for KvTuning
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.