pub struct PerformanceConfig {
pub worker_threads: Option<usize>,
pub imap_pool_size: usize,
pub smtp_pool_size: usize,
pub read_buffer_kb: usize,
pub write_buffer_kb: usize,
}Expand description
Runtime performance tuning parameters.
Exposed via the [performance] TOML section. Defaults are conservative
values that work well on typical single-node deployments. Increase pool
sizes and buffer sizes on high-traffic installations with ample RAM.
Fields§
§worker_threads: Option<usize>Default: None (use Tokio’s default, typically the number of logical
CPUs). Set to override the number of Tokio worker threads at runtime
startup. Values of 0 are rejected by validation.
imap_pool_size: usizeDefault: 64. Maximum number of concurrent IMAP connections the server
will accept per listener socket before new connections are queued.
smtp_pool_size: usizeDefault: 64. Maximum number of concurrent SMTP connections the server
will accept per listener socket before new connections are queued.
read_buffer_kb: usizeDefault: 64. Read buffer size in kibibytes allocated per connection.
Larger values reduce system-call overhead on bulk transfers at the cost
of memory.
write_buffer_kb: usizeDefault: 64. Write buffer size in kibibytes allocated per connection.
Larger values reduce system-call overhead on bulk transfers at the cost
of memory.
Implementations§
Source§impl PerformanceConfig
impl PerformanceConfig
Sourcepub fn validate(&self) -> Result<()>
pub fn validate(&self) -> Result<()>
Validate performance configuration values.
Returns an error if any pool size or buffer size is zero, or if
worker_threads is explicitly set to zero.
Sourcepub fn effective_worker_threads(&self) -> usize
pub fn effective_worker_threads(&self) -> usize
Return worker_threads or a sensible fallback based on the number of
logical CPUs (minimum 1).
Trait Implementations§
Source§impl Clone for PerformanceConfig
impl Clone for PerformanceConfig
Source§fn clone(&self) -> PerformanceConfig
fn clone(&self) -> PerformanceConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more