remove rocksdb_max_open_files option

default for RocksDB is -1 and conduwuit already raises the
soft and hard nofile limits at startup.

Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
strawberry 2024-01-18 01:06:45 -05:00 committed by June
parent 6ffc54e241
commit fae00e5136
2 changed files with 1 additions and 13 deletions

View file

@ -39,8 +39,6 @@ pub struct Config {
pub allow_check_for_updates: bool, pub allow_check_for_updates: bool,
#[serde(default = "default_conduit_cache_capacity_modifier")] #[serde(default = "default_conduit_cache_capacity_modifier")]
pub conduit_cache_capacity_modifier: f64, pub conduit_cache_capacity_modifier: f64,
#[serde(default = "default_rocksdb_max_open_files")]
pub rocksdb_max_open_files: i32,
#[serde(default = "default_pdu_cache_capacity")] #[serde(default = "default_pdu_cache_capacity")]
pub pdu_cache_capacity: u32, pub pdu_cache_capacity: u32,
#[serde(default = "default_cleanup_second_interval")] #[serde(default = "default_cleanup_second_interval")]
@ -96,7 +94,6 @@ pub struct Config {
#[serde(default = "default_turn_ttl")] #[serde(default = "default_turn_ttl")]
pub turn_ttl: u64, pub turn_ttl: u64,
pub rocksdb_log_path: Option<PathBuf>,
#[serde(default = "default_rocksdb_log_level")] #[serde(default = "default_rocksdb_log_level")]
pub rocksdb_log_level: String, pub rocksdb_log_level: String,
#[serde(default = "default_rocksdb_max_log_file_size")] #[serde(default = "default_rocksdb_max_log_file_size")]
@ -191,11 +188,6 @@ impl fmt::Display for Config {
"Cache capacity modifier", "Cache capacity modifier",
&self.conduit_cache_capacity_modifier.to_string(), &self.conduit_cache_capacity_modifier.to_string(),
), ),
#[cfg(feature = "rocksdb")]
(
"Maximum open files for RocksDB",
&self.rocksdb_max_open_files.to_string(),
),
("PDU cache capacity", &self.pdu_cache_capacity.to_string()), ("PDU cache capacity", &self.pdu_cache_capacity.to_string()),
( (
"Cleanup interval in seconds", "Cleanup interval in seconds",
@ -355,10 +347,6 @@ fn default_conduit_cache_capacity_modifier() -> f64 {
1.0 1.0
} }
fn default_rocksdb_max_open_files() -> i32 {
1000
}
fn default_pdu_cache_capacity() -> u32 { fn default_pdu_cache_capacity() -> u32 {
150_000 150_000
} }

View file

@ -69,7 +69,7 @@ fn db_options(rocksdb_cache: &rocksdb::Cache, config: &Config) -> rocksdb::Optio
db_opts.set_level_compaction_dynamic_level_bytes(true); db_opts.set_level_compaction_dynamic_level_bytes(true);
db_opts.create_if_missing(true); db_opts.create_if_missing(true);
db_opts.increase_parallelism(num_cpus::get() as i32); db_opts.increase_parallelism(num_cpus::get() as i32);
db_opts.set_max_open_files(config.rocksdb_max_open_files); //db_opts.set_max_open_files(config.rocksdb_max_open_files);
db_opts.set_compression_type(rocksdb::DBCompressionType::Zstd); db_opts.set_compression_type(rocksdb::DBCompressionType::Zstd);
db_opts.set_compaction_style(rocksdb::DBCompactionStyle::Level); db_opts.set_compaction_style(rocksdb::DBCompactionStyle::Level);
db_opts.optimize_level_style_compaction(10 * 1024 * 1024); db_opts.optimize_level_style_compaction(10 * 1024 * 1024);