pub struct RateLimitConfig {
pub interval_log2: i8,
pub burst: u32,
pub leak_shift: u8,
pub global_rate_hz: f64,
pub global_burst: f64,
}Expand description
Rate-limit policy, mirroring chrony’s ratelimit interval/burst/leak.
Fields§
§interval_log2: i8log2 of the mean seconds between responses to one client. 3 = one response per 8 s, chrony’s default.
burst: u32How many responses a client may take back to back after being quiet.
leak_shift: u8Emit a Kiss-o’-Death to one dropped request in 2^leak_shift. Never 0: answering every dropped request turns the limiter into the amplifier it exists to prevent.
global_rate_hz: f64Ceiling on responses per second across all clients. 0 disables it.
Per-client limiting alone is defeated by table churn: once the client population exceeds the table, every request arrives from an address we have forgotten, gets a fresh bucket, and is answered. TIMECORP S12b (100k addresses into a 16k table) showed the reply ratio climbing back to 100% for exactly that reason. A global bucket is the backstop that bounds total output no matter how the address space is shuffled.
Set high enough not to hinder a busy legitimate server; it exists to bound the worst case, not to shape normal traffic.
global_burst: f64Global burst allowance, in responses.
Trait Implementations§
Source§impl Clone for RateLimitConfig
impl Clone for RateLimitConfig
Source§fn clone(&self) -> RateLimitConfig
fn clone(&self) -> RateLimitConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more