pub struct Config {Show 18 fields
pub max_clones: usize,
pub min_free_bytes: u64,
pub ram_budget: Option<u64>,
pub disk_budget: Option<u64>,
pub queue_wait: Duration,
pub clone_disk_warn: u64,
pub port_range: RangeInclusive<u16>,
pub default_max_age_secs: u64,
pub ready_timeout: Duration,
pub stop_timeout: Duration,
pub scheduler_tick: Duration,
pub router: bool,
pub router_port: u16,
pub router_listen: IpAddr,
pub idle_sleep: Option<Duration>,
pub idle_reap: Option<Duration>,
pub backend: BackendKind,
pub zfs_dataset: Option<String>,
}Fields§
§max_clones: usize§min_free_bytes: u64§ram_budget: Option<u64>Total memory the running clones may reserve; None means no limit.
disk_budget: Option<u64>Total disk the clones may use; None means no limit.
queue_wait: DurationHow long a create waits for room under a budget before it fails.
clone_disk_warn: u64A clone that grows past this many bytes gets a warning.
port_range: RangeInclusive<u16>§default_max_age_secs: u64§ready_timeout: Duration§stop_timeout: Duration§scheduler_tick: DurationHow often the template scheduler looks for work; not user-settable, tests shorten it.
router: boolServe every clone on one port, picked by database name; off makes url the direct URL.
router_port: u16§router_listen: IpAddrThe address the router binds; 0.0.0.0 makes it reachable from the network.
idle_sleep: Option<Duration>A clone with no connections for this long is put to sleep; None (off) never.
idle_reap: Option<Duration>An unnamed, unprotected clone idle for this long is destroyed; None (off) never.
backend: BackendKindWhich clone back end to use; auto detects it from the file system. Chosen once at start.
zfs_dataset: Option<String>The ZFS dataset Mitosis owns (for example tank/mitosis); None when not set.
Implementations§
Source§impl Config
impl Config
Sourcepub fn load(home: &Home) -> Result<Config>
pub fn load(home: &Home) -> Result<Config>
The defaults, then <home>/config.toml, then the MITOSIS_* environment variables.
Sourcepub fn reloaded(&self, home: &Home) -> Result<Config>
pub fn reloaded(&self, home: &Home) -> Result<Config>
Like load, but keeps the settings nobody can set from file or environment.
Sourcepub fn describe(home: &Home) -> Result<Vec<ConfigEntry>>
pub fn describe(home: &Home) -> Result<Vec<ConfigEntry>>
One entry per setting with its current value and where it came from.