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

use get_physical for only physical core count

parent 0352ea7d
No related branches found
No related tags found
No related merge requests found
...@@ -256,8 +256,8 @@ allow_check_for_updates = true ...@@ -256,8 +256,8 @@ allow_check_for_updates = true
# Time in seconds before RocksDB will forcibly rotate logs. Defaults to 0. # Time in seconds before RocksDB will forcibly rotate logs. Defaults to 0.
#rocksdb_log_time_to_roll = 0 #rocksdb_log_time_to_roll = 0
# Amount of threads that RocksDB will use for parallelism. Set to 0 to use all your CPUs. # Amount of threads that RocksDB will use for parallelism. Set to 0 to use all your physical cores.
# Defaults to your CPU count divided by 2 (half) # Defaults to your CPU physical core count (not logical threads) count divided by 2 (half)
#rocksdb_parallelism_threads = 0 #rocksdb_parallelism_threads = 0
......
...@@ -507,7 +507,7 @@ fn default_rocksdb_log_time_to_roll() -> usize { ...@@ -507,7 +507,7 @@ fn default_rocksdb_log_time_to_roll() -> usize {
} }
fn default_rocksdb_parallelism_threads() -> usize { fn default_rocksdb_parallelism_threads() -> usize {
num_cpus::get() / 2 num_cpus::get_physical() / 2
} }
// I know, it's a great name // I know, it's a great name
......
...@@ -48,7 +48,7 @@ fn db_options(rocksdb_cache: &rocksdb::Cache, config: &Config) -> rocksdb::Optio ...@@ -48,7 +48,7 @@ fn db_options(rocksdb_cache: &rocksdb::Cache, config: &Config) -> rocksdb::Optio
}; };
let threads = if config.rocksdb_parallelism_threads == 0 { let threads = if config.rocksdb_parallelism_threads == 0 {
num_cpus::get() // max CPUs if user specified 0 num_cpus::get_physical() // max cores if user specified 0
} else { } else {
config.rocksdb_parallelism_threads config.rocksdb_parallelism_threads
}; };
......
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