Skip to content
Snippets Groups Projects
Commit 9f245281 authored by 🥺's avatar 🥺 :transgender_flag: Committed by 🥺
Browse files

never allow only 1 tokio worker or rocksdb parallelism thread (max compare)

parent d172a688
No related branches found
No related tags found
No related merge requests found
......@@ -22,7 +22,7 @@ pub(crate) fn db_options(config: &Config, env: &mut Env, row_cache: &Cache, col_
// Processing
let threads = if config.rocksdb_parallelism_threads == 0 {
num_cpus::get() // max cores if user specified 0
std::cmp::max(2, num_cpus::get()) // max cores if user specified 0
} else {
config.rocksdb_parallelism_threads
};
......
......@@ -515,7 +515,7 @@ fn init(args: clap::Args) -> Result<Server, Error> {
.enable_io()
.enable_time()
.thread_name("conduwuit:worker")
.worker_threads(num_cpus::get())
.worker_threads(std::cmp::max(2, num_cpus::get()))
.build()
.unwrap(),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment