From 9100af9974c12d06a917ce0715b636b5d1b237f2 Mon Sep 17 00:00:00 2001 From: strawberry Date: Thu, 21 Nov 2024 23:45:16 -0500 Subject: [PATCH] add eventid_pdu database cf cache Signed-off-by: strawberry --- src/core/config/mod.rs | 6 ++++++ src/database/opts.rs | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/src/core/config/mod.rs b/src/core/config/mod.rs index 355881b3..753a08fa 100644 --- a/src/core/config/mod.rs +++ b/src/core/config/mod.rs @@ -198,6 +198,10 @@ pub struct Config { #[serde(default = "default_eventidshort_cache_capacity")] pub eventidshort_cache_capacity: u32, + /// default: varies by system + #[serde(default = "default_eventid_pdu_cache_capacity")] + pub eventid_pdu_cache_capacity: u32, + /// default: varies by system #[serde(default = "default_shortstatekey_cache_capacity")] pub shortstatekey_cache_capacity: u32, @@ -2040,6 +2044,8 @@ fn default_shorteventid_cache_capacity() -> u32 { parallelism_scaled_u32(50_000) fn default_eventidshort_cache_capacity() -> u32 { parallelism_scaled_u32(25_000).saturating_add(100_000) } +fn default_eventid_pdu_cache_capacity() -> u32 { parallelism_scaled_u32(25_000).saturating_add(100_000) } + fn default_shortstatekey_cache_capacity() -> u32 { parallelism_scaled_u32(10_000).saturating_add(100_000) } fn default_statekeyshort_cache_capacity() -> u32 { parallelism_scaled_u32(10_000).saturating_add(100_000) } diff --git a/src/database/opts.rs b/src/database/opts.rs index 46fb4c54..732f571f 100644 --- a/src/database/opts.rs +++ b/src/database/opts.rs @@ -136,6 +136,14 @@ pub(crate) fn cf_options( cache_size(cfg, cfg.eventidshort_cache_capacity, 64)?, ), + "eventid_pduid" => set_table_with_new_cache( + &mut opts, + cfg, + cache, + name, + cache_size(cfg, cfg.eventid_pdu_cache_capacity, 64)?, + ), + "shorteventid_authchain" => { set_table_with_new_cache( &mut opts,