mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 23:21:59 +00:00
Added thread_factor = 2 constant for initial value calculation of global_max_threads
This commit is contained in:
parent
d94e9c4263
commit
87f25c6864
@ -1112,8 +1112,10 @@ int Server::main(const std::vector<std::string> & /*args*/)
|
||||
auto global_max_threads = config->getInt("global_max_threads", 0);
|
||||
LOG_DEBUG(adqm_log,"From config.xml global_max_threads: {}", global_max_threads);
|
||||
if (global_max_threads == -1) {
|
||||
// Based on tests global_max_threads has an optimal value when it's about two times of logical CPU cores
|
||||
constexpr size_t thread_factor = 2;
|
||||
LOG_DEBUG(adqm_log,"number of logical cores: {}", std::thread::hardware_concurrency());
|
||||
global_max_threads = std::thread::hardware_concurrency()*2;
|
||||
global_max_threads = std::thread::hardware_concurrency()*thread_factor;
|
||||
}
|
||||
LOG_DEBUG(adqm_log,"Finally global_max_threads: {}", global_max_threads);
|
||||
global_context->getProcessList().setGlobalMaxThreads(global_max_threads);
|
||||
|
Loading…
Reference in New Issue
Block a user