TaobenchConfig

Struct TaobenchConfig 

Source
pub struct TaobenchConfig {
    pub client_threads: usize,
    pub slow_threads: usize,
    pub cache_capacity_mib: usize,
    pub target_hit_pct: usize,
    pub slow_path_sleep_us: u64,
    pub slow_path_p99_us: u64,
    pub arrival_rate: usize,
}
Expand description

User-facing config for the Taobench workload. User-facing config for the Taobench workload — a bounded, evicting key-value cache with a fast hit path and a slow miss path, driven to a steady-state hit ratio.

All fields are integer/scalar so the type keeps Eq + Hash (fractional knobs are expressed as integer percents). Every field has a chainable builder setter; Default is a useful working config.

Fields§

§client_threads: usize

CLIENT threads that issue lookups and serve hits. 0 resolves to the allocated guest cpuset CPU count (one client per CPU).

§slow_threads: usize

SLOW dispatcher threads that serve misses (sleep + fill + wake). 0 resolves to max(1, client_threads / 3), the real’s fast:slow staffing ratio.

§cache_capacity_mib: usize

Resident cache budget in MiB. The cache FIFO-evicts to stay near this many bytes’ worth of objects; larger than the guest LLC makes the value touch a real memory-bandwidth cost.

§target_hit_pct: usize

Target steady-state hit ratio, in percent (1..=99). The key range is sized capacity / target_hit so a uniform key stream hits at this rate at equilibrium. Clamped into range at consumption.

§slow_path_sleep_us: u64

Simulated backing-store fetch latency on a miss, in microseconds (the slow dispatcher sleeps this long before filling). 0 keeps the slow path as a pure thread hop with no sleep (and disables the heavy tail — a zero median has no Pareto scale, so the fetch stays a no-op regardless of slow_path_p99_us). When slow_path_sleep_us > 0 and slow_path_p99_us > slow_path_sleep_us this is the MEDIAN (p50) of a heavy-tailed service-time distribution rather than a fixed latency (see slow_path_p99_us).

§slow_path_p99_us: u64

Heavy-tailed slow-path service time: the p99 of the simulated backing-store fetch, in microseconds. When > slow_path_sleep_us, each miss’s fetch sleep is drawn from a Pareto distribution whose median is slow_path_sleep_us and whose 99th percentile is this value — most fetches near the median, a heavy tail of rare slow fetches (GC pauses, cold cache, disk seeks), the realistic power-law shape a backing store exhibits. 0 (default), any value <= slow_path_sleep_us, OR slow_path_sleep_us == 0 (a zero median has no Pareto scale) keeps the fixed-latency behavior (every fetch sleeps exactly slow_path_sleep_us — the legacy path, byte-identical). The tail is clamped at a fixed maximum so a pathological draw cannot park a dispatcher off-CPU unboundedly. A ktstr enhancement beyond the reference, whose per-request slow-path service time is a FIXED sleep with no tail (the reference’s [target/2, 2×target] uniform jitter + idle-poll backoff is a separate poll/idle-wait knob, not the per-request fetch), so the open-loop serve-latency tail (crate::workload::TaobenchConfig::arrival_rate) reflects realistic backing-store variance.

§arrival_rate: usize

Open-loop arrival rate, AGGREGATE ops/sec across all client threads (the taobench analog of schbench’s -R). 0 (default) = CLOSED loop: each client blocks until its request completes before issuing the next (the legacy behavior, byte-identical). Non-zero = OPEN loop: each client has a fixed intended-arrival SCHEDULE (arrival_rate / client_threads per client) independent of completion, and serve latency is measured from that intended time. A client still holds at most one outstanding request, so a slow completion delays the next issue; that backlog is folded into the late requests’ serve latency (coordinated-omission correction) rather than omitted. Divided evenly across resolved clients. (Named for the standard queueing-theory term; the schbench analog is requests_per_sec, which is a verbatim mirror of schbench’s own -R CLI flag — a constraint this ktstr-added field, with no reference -R to mirror, does not share.)

Implementations§

Source§

impl TaobenchConfig

Source

pub fn client_threads(self, n: usize) -> Self

Set the client thread count (0 = one per allocated CPU).

Source

pub fn slow_threads(self, n: usize) -> Self

Set the slow dispatcher thread count (0 = max(1, client_threads/3)).

Source

pub fn cache_capacity_mib(self, mib: usize) -> Self

Set the resident cache budget in MiB.

Source

pub fn target_hit_pct(self, pct: usize) -> Self

Set the target steady-state hit ratio in percent (1..=99).

Source

pub fn slow_path_sleep_us(self, us: u64) -> Self

Set the simulated backing-store fetch latency on a miss, microseconds (the MEDIAN when slow_path_p99_us enables the heavy tail; 0 keeps the fetch a no-op and also disables the tail — a zero median has no Pareto scale).

Source

pub fn slow_path_p99_us(self, us: u64) -> Self

Set the heavy-tailed slow-path service-time p99 in microseconds (0 or <= slow_path_sleep_us = fixed latency, the legacy behavior; also fixed when slow_path_sleep_us == 0, a zero median having no Pareto scale). When larger than a non-zero slow_path_sleep_us, each miss’s fetch is drawn from a Pareto with median slow_path_sleep_us and this p99.

Source

pub fn arrival_rate(self, ops_per_sec: usize) -> Self

Set the open-loop AGGREGATE arrival rate in ops/sec across all clients (0 = closed loop). Divided evenly across resolved client threads; serve latency is then measured from the intended arrival (coordinated-omission).

Trait Implementations§

Source§

impl Clone for TaobenchConfig

Source§

fn clone(&self) -> TaobenchConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TaobenchConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for TaobenchConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for TaobenchConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Hash for TaobenchConfig

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for TaobenchConfig

Source§

fn eq(&self, other: &TaobenchConfig) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for TaobenchConfig

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for TaobenchConfig

Source§

impl StructuralPartialEq for TaobenchConfig

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

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
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

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
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

§

impl<T> MaybeSend for T
where T: Send,

§

impl<T> MaybeSend for T
where T: Send,