pub struct Cache {Show 15 fields
pub capacity_modifier: f64,
pub pdu_capacity: u32,
pub auth_chain_capacity: u32,
pub shorteventid_capacity: u32,
pub eventidshort_capacity: u32,
pub eventid_pdu_capacity: u32,
pub eventid_backoff_capacity: u32,
pub shortstatekey_capacity: u32,
pub statekeyshort_capacity: u32,
pub servernameevent_data_capacity: u32,
pub mediaid_lazycontent_capacity: u32,
pub resolver_capacity: u32,
pub servername_status_capacity: u32,
pub stateinfo_capacity: u32,
pub space_hierarchy: SpaceHierarchy,
}Expand description
Cache sizes
Sizes the RocksDB block caches reserved for specific database columns,
and the in-memory room state cache (stateinfo_capacity). Capacities
count entries, not bytes. Most columns without a key here share one
cache carved from rocksdb.cache_capacity_mb. Sizes are fixed at
startup.
Tips:
capacity_modifieralso scalesrocksdb.write_buffer_capacity_mb, but notrocksdb.cache_capacity_mb.
Fields§
§capacity_modifier: f64Multiplies cache capacities by a floating-point factor.
Increase this value to use spare memory for performance, or reduce it
when memory is limited. Individual capacities such as
cache.auth_chain_capacity scale with the CPU core count by default.
default: 1.0 legacy: cache_capacity_modifier conduit_cache_capacity_modifier
pdu_capacity: u32Maximum number of entries in the RocksDB block cache shared by the
pduid_pdu and eventid_outlierpdu column families: a PDU’s full
body, keyed by its PDU ID, and the same body keyed by event ID when
the PDU is an outlier.
This is an entry count, not a byte size. The cache’s actual capacity
in bytes is this value multiplied by an internal per-column-family
key+value size estimate, then multiplied by cache.capacity_modifier.
Scaled by your CPU core count by default; see
cache.capacity_modifier to scale this along with the other
individual LRU caches at once.
default: varies by system legacy: pdu_cache_capacity
auth_chain_capacity: u32Maximum number of entries in the RocksDB block cache for the
authchainkey_authchain column family: a room event’s full auth
chain, keyed by the set of events the chain was derived from.
Same entry-count semantics as cache.pdu_capacity above; see there
for how this becomes a byte capacity and how
cache.capacity_modifier applies.
default: varies by system legacy: auth_chain_cache_capacity
shorteventid_capacity: u32Maximum number of entries in the RocksDB block cache for the
shorteventid_eventid column family: an event’s full event ID,
looked up from its short event ID.
Same entry-count semantics as cache.pdu_capacity.
default: varies by system legacy: shorteventid_cache_capacity
eventidshort_capacity: u32Maximum number of entries in the RocksDB block cache for the
eventid_shorteventid column family: an event’s short event ID,
looked up from its full event ID.
This is the reverse lookup of cache.shorteventid_capacity.
Same entry-count semantics as cache.pdu_capacity.
default: varies by system legacy: eventidshort_cache_capacity
eventid_pdu_capacity: u32Maximum number of entries in the RocksDB block cache for the
eventid_pduid column family: an event’s PDU ID, looked up from its
full event ID.
Same entry-count semantics as cache.pdu_capacity.
default: varies by system legacy: eventid_pdu_cache_capacity
eventid_backoff_capacity: u32Maximum number of entries in the RocksDB block cache for the
eventid_backoff column family: the recent fetch, auth, upgrade, and
delivery outcomes an event is rate-gated against, keyed by federation
step, event ID, and time bucket.
Same entry-count semantics as cache.pdu_capacity. A server working
through a large missing-ancestry gap reads this column heavily.
default: varies by system legacy: eventid_backoff_cache_capacity
shortstatekey_capacity: u32Maximum number of entries in the RocksDB block cache for the
shortstatekey_statekey column family: a state event’s full state
key, looked up from its short state key.
Same entry-count semantics as cache.pdu_capacity.
default: varies by system legacy: shortstatekey_cache_capacity
statekeyshort_capacity: u32Maximum number of entries in the RocksDB block cache for the
statekey_shortstatekey column family: a state event’s short state
key, looked up from its full state key.
This is the reverse lookup of cache.shortstatekey_capacity.
Same entry-count semantics as cache.pdu_capacity.
default: varies by system legacy: statekeyshort_cache_capacity
servernameevent_data_capacity: u32Maximum number of entries in the RocksDB block cache for the
servernameevent_data column family: outbound federation events
(PDUs and EDUs) queued for delivery, keyed by destination server
name.
Same entry-count semantics as cache.pdu_capacity.
default: varies by system legacy: servernameevent_data_cache_capacity
mediaid_lazycontent_capacity: u32Maximum number of entries in the RocksDB block cache for the
mediaid_lazycontent column family: preview images staged by the URL
preview fetcher, keyed by media ID, until a download promotes the row.
Same entry-count semantics as cache.pdu_capacity, against a modal
256 KiB entry. Staged rows are read once and deleted at promotion, so
this mostly holds index blocks, and a single outsized preview can
exceed the whole pool.
default: 128 legacy: mediaid_lazycontent_cache_capacity
resolver_capacity: u32Maximum number of entries in the RocksDB block cache pool shared by the
servername_destination and servername_override column families: a
remote server’s resolved federation destination, keyed by server name,
and the address override for a resolved hostname.
Same entry-count semantics as cache.pdu_capacity, counted across the
pool rather than per column.
default: varies by system legacy: resolver_cache_capacity
servername_status_capacity: u32Maximum number of entries in the RocksDB block cache for the
servername_status column family: a remote server’s recent
reachability outcome, keyed by server name and time bucket.
Same entry-count semantics as cache.pdu_capacity.
default: varies by system legacy: servername_status_cache_capacity
stateinfo_capacity: u32Maximum number of entries in the in-memory LRU cache of decompressed
room state (a list of short state-info entries per state hash), used
by the state compressor to avoid re-walking
shortstatehash_statediff on every lookup.
Unlike the other caches on this page, this one is not backed by
RocksDB: it is a plain in-process cache sized directly in entries,
with no per-entry byte-size conversion. cache.capacity_modifier
still applies to it.
default: varies by system legacy: stateinfo_cache_capacity
space_hierarchy: SpaceHierarchySettings for cache space hierarchy.
display: section
Implementations§
Trait Implementations§
impl Copy for Cache
Source§impl<'de> Deserialize<'de> for Cache
impl<'de> Deserialize<'de> for Cache
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for Cache
impl RefUnwindSafe for Cache
impl Send for Cache
impl Sync for Cache
impl Unpin for Cache
impl UnsafeUnpin for Cache
impl UnwindSafe for Cache
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> ExpectInto for T
impl<T> ExpectInto for T
Source§impl<T> Expected for T
impl<T> Expected for T
Source§fn expected_add(self, rhs: Self) -> Selfwhere
Self: CheckedAdd + Sized,
fn expected_add(self, rhs: Self) -> Selfwhere
Self: CheckedAdd + Sized,
rhs with an expectation that the operation is valid. Read moreSource§fn expected_sub(self, rhs: Self) -> Selfwhere
Self: CheckedSub + Sized,
fn expected_sub(self, rhs: Self) -> Selfwhere
Self: CheckedSub + Sized,
rhs with an expectation that the operation is valid. Read moreSource§fn expected_mul(self, rhs: Self) -> Selfwhere
Self: CheckedMul + Sized,
fn expected_mul(self, rhs: Self) -> Selfwhere
Self: CheckedMul + Sized,
rhs with an expectation that the operation is valid. Read moreSource§fn expected_div(self, rhs: Self) -> Selfwhere
Self: CheckedDiv + Sized,
fn expected_div(self, rhs: Self) -> Selfwhere
Self: CheckedDiv + Sized,
rhs with an expectation that the operation is valid. Read moreSource§fn expected_rem(self, rhs: Self) -> Selfwhere
Self: CheckedRem + Sized,
fn expected_rem(self, rhs: Self) -> Selfwhere
Self: CheckedRem + Sized,
§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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 moreimpl<T> JsonCastable<CanonicalJsonValue> for T
impl<T> JsonCastable<Value> for T
§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the foreground set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red() and
green(), which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg():
use yansi::{Paint, Color};
painted.fg(Color::White);Set foreground color to white using white().
use yansi::Paint;
painted.white();§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the background set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red() and
on_green(), which have the same functionality but
are pithier.
§Example
Set background color to red using fg():
use yansi::{Paint, Color};
painted.bg(Color::Red);Set background color to red using on_red().
use yansi::Paint;
painted.on_red();§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling [Attribute] value.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold() and
underline(), which have the same functionality
but are pithier.
§Example
Make text bold using attr():
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);Make text bold using using bold().
use yansi::Paint;
painted.bold();§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi [Quirk] value.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask() and
wrap(), which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk():
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);Enable wrapping using wrap().
use yansi::Paint;
painted.wrap();§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
fn clear(&self) -> Painted<&T>
renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the [Condition] value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted only when both stdout and stderr are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> ServiceExt for T
impl<T> ServiceExt for T
§fn add_extension<T>(self, value: T) -> AddExtension<Self, T>where
Self: Sized,
fn add_extension<T>(self, value: T) -> AddExtension<Self, T>where
Self: Sized,
§fn compression(self) -> Compression<Self>where
Self: Sized,
fn compression(self) -> Compression<Self>where
Self: Sized,
§fn decompression(self) -> Decompression<Self>where
Self: Sized,
fn decompression(self) -> Decompression<Self>where
Self: Sized,
§fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
§fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
§fn follow_redirects(self) -> FollowRedirect<Self>where
Self: Sized,
fn follow_redirects(self) -> FollowRedirect<Self>where
Self: Sized,
§fn sensitive_headers(
self,
headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveRequestHeaders<SetSensitiveResponseHeaders<Self>>where
Self: Sized,
fn sensitive_headers(
self,
headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveRequestHeaders<SetSensitiveResponseHeaders<Self>>where
Self: Sized,
§fn sensitive_request_headers(
self,
headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveRequestHeaders<Self>where
Self: Sized,
fn sensitive_request_headers(
self,
headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveRequestHeaders<Self>where
Self: Sized,
§fn sensitive_response_headers(
self,
headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveResponseHeaders<Self>where
Self: Sized,
fn sensitive_response_headers(
self,
headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveResponseHeaders<Self>where
Self: Sized,
§fn override_request_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetRequestHeader<Self, M>where
Self: Sized,
fn override_request_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetRequestHeader<Self, M>where
Self: Sized,
§fn append_request_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetRequestHeader<Self, M>where
Self: Sized,
fn append_request_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetRequestHeader<Self, M>where
Self: Sized,
§fn insert_request_header_if_not_present<M>(
self,
header_name: HeaderName,
make: M,
) -> SetRequestHeader<Self, M>where
Self: Sized,
fn insert_request_header_if_not_present<M>(
self,
header_name: HeaderName,
make: M,
) -> SetRequestHeader<Self, M>where
Self: Sized,
§fn override_response_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetResponseHeader<Self, M>where
Self: Sized,
fn override_response_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetResponseHeader<Self, M>where
Self: Sized,
§fn append_response_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetResponseHeader<Self, M>where
Self: Sized,
fn append_response_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetResponseHeader<Self, M>where
Self: Sized,
§fn insert_response_header_if_not_present<M>(
self,
header_name: HeaderName,
make: M,
) -> SetResponseHeader<Self, M>where
Self: Sized,
fn insert_response_header_if_not_present<M>(
self,
header_name: HeaderName,
make: M,
) -> SetResponseHeader<Self, M>where
Self: Sized,
§fn catch_panic(self) -> CatchPanic<Self, DefaultResponseForPanic>where
Self: Sized,
fn catch_panic(self) -> CatchPanic<Self, DefaultResponseForPanic>where
Self: Sized,
500 Internal Server responses. Read moreSource§impl<T> Tried for T
impl<T> Tried for T
Source§fn try_add(self, rhs: Self) -> Result<Self>where
Self: CheckedAdd + Sized,
fn try_add(self, rhs: Self) -> Result<Self>where
Self: CheckedAdd + Sized,
rhs with checked arithmetic. Read moreSource§fn try_sub(self, rhs: Self) -> Result<Self>where
Self: CheckedSub + Sized,
fn try_sub(self, rhs: Self) -> Result<Self>where
Self: CheckedSub + Sized,
rhs with checked arithmetic. Read moreSource§fn try_mul(self, rhs: Self) -> Result<Self>where
Self: CheckedMul + Sized,
fn try_mul(self, rhs: Self) -> Result<Self>where
Self: CheckedMul + Sized,
rhs with checked arithmetic. Read more