use get_physical for only physical core count

Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
strawberry 2024-03-04 20:52:57 -05:00 committed by June
parent 0352ea7dda
commit 90d90c46da
3 changed files with 4 additions and 4 deletions

View file

@ -256,8 +256,8 @@ allow_check_for_updates = true
# Time in seconds before RocksDB will forcibly rotate logs. Defaults to 0.
#rocksdb_log_time_to_roll = 0
# Amount of threads that RocksDB will use for parallelism. Set to 0 to use all your CPUs.
# Defaults to your CPU count divided by 2 (half)
# Amount of threads that RocksDB will use for parallelism. Set to 0 to use all your physical cores.
# Defaults to your CPU physical core count (not logical threads) count divided by 2 (half)
#rocksdb_parallelism_threads = 0

View file

@ -507,7 +507,7 @@ fn default_rocksdb_log_time_to_roll() -> usize {
}
fn default_rocksdb_parallelism_threads() -> usize {
num_cpus::get() / 2
num_cpus::get_physical() / 2
}
// I know, it's a great name

View file

@ -48,7 +48,7 @@ fn db_options(rocksdb_cache: &rocksdb::Cache, config: &Config) -> rocksdb::Optio
};
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 {
config.rocksdb_parallelism_threads
};