summaryrefslogtreecommitdiff
path: root/sql/sys_vars.cc
diff options
context:
space:
mode:
authorSergey Vojtovich <svoj@mariadb.org>2013-11-05 09:18:59 +0400
committerSergey Vojtovich <svoj@mariadb.org>2013-11-05 09:18:59 +0400
commitfd9f1638ea7401e9bc72653882fded4c0dee15d8 (patch)
tree930887a8e4febd36cc7a2539a0c225376d0924d8 /sql/sys_vars.cc
parent52dea41052bc1be1efbe59c320046d7e62cfd0a6 (diff)
downloadmariadb-git-fd9f1638ea7401e9bc72653882fded4c0dee15d8.tar.gz
MDEV-5205 - MariaDB does not start if more than 128 cpu's are available
- thread_pool_size command line option upper limit increased to 100 000 (same as for max_connections) - thread_pool_size system variable upper limit is maximum of 128 or the value given at command line - thread groups are now allocated dynamically Different limit for command line option and system variable was done to avoid additional mutex for all_groups and threadpool_max_size.
Diffstat (limited to 'sql/sys_vars.cc')
-rw-r--r--sql/sys_vars.cc14
1 files changed, 13 insertions, 1 deletions
diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc
index b97f2a9dc1e..8bb9f57157e 100644
--- a/sql/sys_vars.cc
+++ b/sql/sys_vars.cc
@@ -2298,6 +2298,18 @@ static bool fix_tp_min_threads(sys_var *, THD *, enum_var_type)
#ifndef _WIN32
+static bool check_threadpool_size(sys_var *self, THD *thd, set_var *var)
+{
+ ulonglong v= var->save_result.ulonglong_value;
+ if (v > threadpool_max_size)
+ {
+ var->save_result.ulonglong_value= threadpool_max_size;
+ return throw_bounds_warning(thd, self->name.str, true, true, v);
+ }
+ return false;
+}
+
+
static bool fix_threadpool_size(sys_var*, THD*, enum_var_type)
{
tp_set_threadpool_size(threadpool_size);
@@ -2342,7 +2354,7 @@ static Sys_var_uint Sys_threadpool_size(
"executing threads (threads in a waiting state do not count as executing).",
GLOBAL_VAR(threadpool_size), CMD_LINE(REQUIRED_ARG),
VALID_RANGE(1, MAX_THREAD_GROUPS), DEFAULT(my_getncpus()), BLOCK_SIZE(1),
- NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0),
+ NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(check_threadpool_size),
ON_UPDATE(fix_threadpool_size)
);
static Sys_var_uint Sys_threadpool_stall_limit(