pub struct Config {
pub cache_size_bytes: usize,
pub prefetch_count: u32,
pub network_timeout_secs: u64,
}Expand description
Aggregated configuration for the filesystem runtime.
This struct holds all tunable parameters for the system. It is typically constructed from command-line arguments or a configuration file and passed down to the core components during initialization. The configuration affects memory usage, I/O behavior, and network operation timeouts.
Fields§
§cache_size_bytes: usizeThe maximum size of the in-memory block cache in bytes.
This parameter controls the memory footprint of the application. A larger cache improves read performance for repeated access but consumes more system RAM. The cache uses an LRU eviction policy when this limit is reached.
prefetch_count: u32The number of blocks to prefetch sequentially during read operations.
This setting optimizes read throughput for sequential access patterns by fetching ahead of the request cursor. A value of 0 disables prefetching, which may be desirable for random access workloads where prefetching would waste bandwidth.
network_timeout_secs: u64The timeout duration in seconds for network operations.
This applies to remote storage backends like S3 or HTTP. It ensures that operations do not hang indefinitely in case of network partitions or unresponsive servers. Operations that exceed this timeout will return an I/O error.
Trait Implementations§
Source§impl Default for Config
impl Default for Config
Source§fn default() -> Self
fn default() -> Self
Provides sensible default values for the configuration.
These defaults are chosen to provide a balance between performance and resource usage for a typical desktop environment: 512MB cache, 4-block prefetch, and 30-second network timeout. These values can be overridden based on available system resources and workload characteristics.
§Returns
Returns a new Config instance with default values.