pub struct RuntimeTuneRecommendation {
pub max_inflight: usize,
pub max_queue: usize,
pub sendfile_threshold_bytes: u64,
}Available on crate feature
autotune only.Expand description
Tuning recommendation independent of server runtime type.
§Examples
use http_handle::runtime_autotune::RuntimeTuneRecommendation;
let rec = RuntimeTuneRecommendation { max_inflight: 128, max_queue: 512, sendfile_threshold_bytes: 65536 };
assert_eq!(rec.max_queue, 512);§Panics
This type does not panic.
Fields§
§max_inflight: usizeMax concurrent inflight requests.
max_queue: usizeMax queued requests.
sendfile_threshold_bytes: u64Threshold for sendfile fast-path.
Implementations§
Source§impl RuntimeTuneRecommendation
impl RuntimeTuneRecommendation
Sourcepub fn from_profile(profile: HostResourceProfile) -> Self
pub fn from_profile(profile: HostResourceProfile) -> Self
Produces recommendation from host profile.
§Examples
use http_handle::runtime_autotune::{HostResourceProfile, RuntimeTuneRecommendation};
let rec = RuntimeTuneRecommendation::from_profile(HostResourceProfile { cpu_cores: 8, memory_mib: 8192 });
assert!(rec.max_inflight >= 64);§Panics
This function does not panic.
Source§impl RuntimeTuneRecommendation
impl RuntimeTuneRecommendation
Sourcepub fn into_perf_limits(self) -> PerfLimits
pub fn into_perf_limits(self) -> PerfLimits
Converts recommendation into high-performance server limits.
§Examples
use http_handle::runtime_autotune::RuntimeTuneRecommendation;
let rec = RuntimeTuneRecommendation { max_inflight: 1, max_queue: 2, sendfile_threshold_bytes: 3 };
#[cfg(feature = "high-perf")]
{
let limits = rec.into_perf_limits();
assert_eq!(limits.max_queue, 2);
}§Panics
This function does not panic.
Trait Implementations§
Source§impl Clone for RuntimeTuneRecommendation
impl Clone for RuntimeTuneRecommendation
Source§fn clone(&self) -> RuntimeTuneRecommendation
fn clone(&self) -> RuntimeTuneRecommendation
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RuntimeTuneRecommendation
impl Debug for RuntimeTuneRecommendation
impl Copy for RuntimeTuneRecommendation
impl Eq for RuntimeTuneRecommendation
impl StructuralPartialEq for RuntimeTuneRecommendation
Auto Trait Implementations§
impl Freeze for RuntimeTuneRecommendation
impl RefUnwindSafe for RuntimeTuneRecommendation
impl Send for RuntimeTuneRecommendation
impl Sync for RuntimeTuneRecommendation
impl Unpin for RuntimeTuneRecommendation
impl UnsafeUnpin for RuntimeTuneRecommendation
impl UnwindSafe for RuntimeTuneRecommendation
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.