never allow only 1 tokio worker or rocksdb parallelism thread (max compare)
Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
parent
d172a6883d
commit
9f245281b1
|
@ -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(),
|
||||
|
||||
|
|
Loading…
Reference in New Issue