pub struct FastCacheConfig {
pub bind_addr: String,
pub max_connections: usize,
pub shard_count: usize,
pub max_memory_bytes: u64,
pub eviction_policy: EvictionPolicy,
pub ttl_sweep_interval_ms: u64,
pub stats_interval_ms: u64,
pub tiers: TierConfig,
pub cuda: CudaConfig,
pub persistence: PersistenceConfig,
pub replication: ReplicationConfig,
}Expand description
Top-level configuration for fast-cache-server.
Fields§
§bind_addr: StringSocket address the server should bind, for example 127.0.0.1:6380.
max_connections: usizeMaximum number of accepted client connections.
shard_count: usizeNumber of storage shards to create. Must be a non-zero power of two.
max_memory_bytes: u64Global memory budget in bytes. 0 disables memory-limit eviction.
eviction_policy: EvictionPolicyPolicy used when a memory limit is configured.
ttl_sweep_interval_ms: u64Interval between TTL maintenance sweeps.
stats_interval_ms: u64Interval between periodic stats reports.
tiers: TierConfigPer-shard tier sizing.
cuda: CudaConfigGPU-facing configuration values.
persistence: PersistenceConfigWAL and snapshot configuration.
replication: ReplicationConfigNative mutation-stream replication configuration.
Implementations§
Source§impl FastCacheConfig
impl FastCacheConfig
Sourcepub fn default_shard_count() -> usize
pub fn default_shard_count() -> usize
Returns the default shard count for the current host.
Sourcepub fn load_from_path(path: &Path) -> Result<Self>
pub fn load_from_path(path: &Path) -> Result<Self>
Loads and validates a TOML configuration file.
Sourcepub fn store_to_path(&self, path: &Path) -> Result<()>
pub fn store_to_path(&self, path: &Path) -> Result<()>
Writes the configuration as pretty TOML, creating parent directories.
Sourcepub fn ensure_paths(&self) -> Result<()>
pub fn ensure_paths(&self) -> Result<()>
Creates directories required by the enabled persistence settings.
Sourcepub fn ttl_sweep_interval(&self) -> Duration
pub fn ttl_sweep_interval(&self) -> Duration
Returns the TTL sweep interval, clamped to at least 1 ms.
Sourcepub fn stats_interval(&self) -> Duration
pub fn stats_interval(&self) -> Duration
Returns the stats interval, clamped to at least 250 ms.
Sourcepub fn per_shard_memory_limit_bytes(&self) -> Option<usize>
pub fn per_shard_memory_limit_bytes(&self) -> Option<usize>
Returns the per-shard memory limit implied by max_memory_bytes.
Sourcepub fn snapshot_interval(&self) -> Duration
pub fn snapshot_interval(&self) -> Duration
Returns the snapshot interval, clamped to at least 1 second.
Trait Implementations§
Source§impl Clone for FastCacheConfig
impl Clone for FastCacheConfig
Source§fn clone(&self) -> FastCacheConfig
fn clone(&self) -> FastCacheConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more