feat(rpc): expose and auto-size replay cache capacity (#5781)

* feat(metrics): expose replay cache pressure

Co-Authored-By: heihutu <heihutu@gmail.com>

* feat(rpc): auto-size replay cache capacity

Co-Authored-By: heihutu <heihutu@gmail.com>

* feat(cache): split runtime memory feature

Co-Authored-By: heihutu <heihutu@gmail.com>

---------

Co-authored-by: heihutu <heihutu@gmail.com>
This commit is contained in:
houseme
2026-08-07 08:52:02 +08:00
committed by GitHub
parent 77f2b948c2
commit 83cdea1f18
12 changed files with 795 additions and 191 deletions
+25
View File
@@ -41,27 +41,52 @@
//! the cache disabled for those buckets. Adding timing noise is not a viable
//! mitigation: it would cost exactly the latency the cache exists to save.
#[cfg(feature = "cache")]
pub mod backend;
#[cfg(feature = "cache")]
pub mod cache;
#[cfg(feature = "cache")]
pub mod config;
#[cfg(feature = "cache")]
pub mod entry;
#[cfg(feature = "cache")]
pub mod error;
#[cfg(feature = "cache")]
pub mod index;
#[cfg(feature = "cache")]
pub mod key;
#[cfg(feature = "cache")]
pub mod memory;
#[cfg(feature = "cache")]
pub mod metrics;
#[cfg(feature = "cache")]
pub mod moka_backend;
#[cfg(feature = "cache")]
pub mod noop;
#[cfg(feature = "runtime-memory")]
mod runtime_memory;
#[cfg(feature = "cache")]
pub mod singleflight;
#[cfg(feature = "cache")]
pub mod starshard_index;
#[cfg(feature = "cache")]
pub mod stats;
#[cfg(feature = "cache")]
pub use cache::{
ObjectDataCache, ObjectDataCacheBodyReservation, ObjectDataCacheFillResult, ObjectDataCacheGetPlan,
ObjectDataCacheGetRequest, ObjectDataCacheInvalidationReason, ObjectDataCacheInvalidationResult, ObjectDataCacheLookup,
ObjectDataCacheReservedBody,
};
#[cfg(feature = "cache")]
pub use config::{ObjectDataCacheConfig, ObjectDataCacheMode};
#[cfg(feature = "cache")]
pub use error::ObjectDataCacheConfigError;
#[cfg(feature = "cache")]
pub use key::{NULL_VERSION_ID, ObjectDataCacheBodyVariant, ObjectDataCacheIdentity, ObjectDataCacheKey};
#[cfg(feature = "runtime-memory")]
pub use runtime_memory::{
EffectiveMemory, MemoryBasis, effective_memory_from_system, resolve_effective_memory, select_effective_memory,
};
#[cfg(feature = "cache")]
pub use stats::{ObjectDataCacheStats, ObjectDataCacheStatsSnapshot};