diff --git a/programs/server/Server.cpp b/programs/server/Server.cpp index 44ee5c87faf..7bb889afdce 100644 --- a/programs/server/Server.cpp +++ b/programs/server/Server.cpp @@ -1160,14 +1160,14 @@ int Server::main(const std::vector & /*args*/) if (config->has("concurrent_threads_soft_limit_num")) { auto value = config->getUInt64("concurrent_threads_soft_limit_num", 0); - if (value > 0) - concurrent_threads_soft_limit = std::min(concurrent_threads_soft_limit, value); + if (value > 0 && value < concurrent_threads_soft_limit) + concurrent_threads_soft_limit = value; } if (config->has("concurrent_threads_soft_limit_ratio_to_cores")) { auto value = config->getUInt64("concurrent_threads_soft_limit_ratio_to_cores", 0) * std::thread::hardware_concurrency(); - if (value > 0) - concurrent_threads_soft_limit = std::min(concurrent_threads_soft_limit, value); + if (value > 0 && value < concurrent_threads_soft_limit) + concurrent_threads_soft_limit = value; } ConcurrencyControl::instance().setMaxConcurrency(concurrent_threads_soft_limit);