Skip to content

Commit

Permalink
updated soft and hard limit
Browse files Browse the repository at this point in the history
Signed-off-by: fzhedu <fzhedu@gmail.com>
  • Loading branch information
fzhedu committed Mar 14, 2022
1 parent 5277e37 commit 6a3add1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
10 changes: 4 additions & 6 deletions dbms/src/Flash/Mpp/MinTSOScheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,11 @@ MinTSOScheduler::MinTSOScheduler(UInt64 soft_limit, UInt64 hard_limit)
{
LOG_FMT_INFO(log, "MinTSOScheduler is disabled!");
}
else if (thread_hard_limit <= thread_soft_limit || thread_hard_limit > OS_THREAD_SOFT_LIMIT)
else if (thread_hard_limit <= thread_soft_limit || thread_hard_limit > OS_THREAD_SOFT_LIMIT) /// the general soft limit of OS threads is no more than 100000.
{
/// generally max_threads == cores, so we support a query runs about 200 tasks simultaneously on a node.
/// besides, the general soft limit of OS threads is no more than 100000.
thread_hard_limit = std::min(10000U, cores * 400U);
thread_soft_limit = std::min(5000U, cores * 200U);
LOG_FMT_INFO(log, "hard limit {} should > soft limit {} and under OS' soft limit of {}, so MinTSOScheduler set them as {}, {} by default, and active_set_soft_limit is {}.", hard_limit, soft_limit, OS_THREAD_SOFT_LIMIT, thread_hard_limit, thread_soft_limit, active_set_soft_limit);
thread_hard_limit = 10000;
thread_soft_limit = 5000;
LOG_FMT_INFO(log, "hard limit {} should > soft limit {} and under maximum {}, so MinTSOScheduler set them as {}, {} by default, and active_set_soft_limit is {}.", hard_limit, soft_limit, OS_THREAD_SOFT_LIMIT, thread_hard_limit, thread_soft_limit, active_set_soft_limit);
}
else
{
Expand Down
4 changes: 2 additions & 2 deletions dbms/src/Interpreters/Settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -332,8 +332,8 @@ struct Settings
"unlimited.") \
M(SettingUInt64, max_network_bandwidth_for_all_users, 0, "The maximum speed of data exchange over the network in bytes per second for all concurrently running queries. Zero means " \
"unlimited.") \
M(SettingUInt64, task_scheduler_thread_soft_limit, 0, "The soft limit of threads for min_tso task scheduler.") \
M(SettingUInt64, task_scheduler_thread_hard_limit, 0, "The hard limit of threads for min_tso task scheduler.") \
M(SettingUInt64, task_scheduler_thread_soft_limit, 5000, "The soft limit of threads for min_tso task scheduler.") \
M(SettingUInt64, task_scheduler_thread_hard_limit, 10000, "The hard limit of threads for min_tso task scheduler.") \
M(SettingUInt64, max_grpc_pollers, 200, "The maximum number of grpc thread pool's non-temporary threads, better tune it up to avoid frequent creation/destruction of threads.") \
M(SettingBool, enable_elastic_threadpool, true, "Enable elastic thread pool for thread create usages.") \
M(SettingUInt64, elastic_threadpool_init_cap, 400, "The size of elastic thread pool.") \
Expand Down

0 comments on commit 6a3add1

Please sign in to comment.