Re: [Maria-developers] [Commits] f21705d: MDEV-7806 - thread_pool_size is not auto-sized
Hi, Sergey! On Nov 17, Sergey Vojtovich wrote:
revision-id: f21705dfbfcd87e46937222eb860727beb21a89b (mariadb-10.1.8-66-gf21705d) parent(s): c0216f1d02e63686f986fa8f352fdf6de61249a7 committer: Sergey Vojtovich timestamp: 2015-11-17 13:13:47 +0400 message:
MDEV-7806 - thread_pool_size is not auto-sized
thread_pool_size is auto-sized before my_getopt(). But my_getopt starts from resetting all options to their default values. So the auto-sized value is lost.
Fixed by autosizing default value directly.
diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index 682d803..e65a939 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -3270,7 +3270,7 @@ static Sys_var_uint Sys_threadpool_size( "This parameter is roughly equivalent to maximum number of concurrently " "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(8), BLOCK_SIZE(1), + VALID_RANGE(1, MAX_THREAD_GROUPS), DEFAULT(my_getncpus()), BLOCK_SIZE(1), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(check_threadpool_size), ON_UPDATE(fix_threadpool_size) );
Strange solution. Why wouldn't you move autosizing after config variables are read? Regards, Sergei Chief Architect MariaDB and security@mariadb.org
Hi Sergei, On Tue, Nov 17, 2015 at 02:23:56PM +0100, Sergei Golubchik wrote:
Hi, Sergey!
On Nov 17, Sergey Vojtovich wrote:
revision-id: f21705dfbfcd87e46937222eb860727beb21a89b (mariadb-10.1.8-66-gf21705d) parent(s): c0216f1d02e63686f986fa8f352fdf6de61249a7 committer: Sergey Vojtovich timestamp: 2015-11-17 13:13:47 +0400 message:
MDEV-7806 - thread_pool_size is not auto-sized
thread_pool_size is auto-sized before my_getopt(). But my_getopt starts from resetting all options to their default values. So the auto-sized value is lost.
Fixed by autosizing default value directly.
diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index 682d803..e65a939 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -3270,7 +3270,7 @@ static Sys_var_uint Sys_threadpool_size( "This parameter is roughly equivalent to maximum number of concurrently " "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(8), BLOCK_SIZE(1), + VALID_RANGE(1, MAX_THREAD_GROUPS), DEFAULT(my_getncpus()), BLOCK_SIZE(1), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(check_threadpool_size), ON_UPDATE(fix_threadpool_size) );
Strange solution. Why wouldn't you move autosizing after config variables are read? Well, it's not a precedent: we already have similar solution for tc_log_size.
Wouldn't autosizing after config variables are read overwrite configured value? If so, we'll have to create special value for thread_pool_size, e.g. if value is 0 then do autosizing, preserve original value otherwise. I wouldn't mind if the above is preferred way. Thanks, Sergey
Hi, Sergey! On Nov 17, Sergey Vojtovich wrote:
On Tue, Nov 17, 2015 at 02:23:56PM +0100, Sergei Golubchik wrote:
On Nov 17, Sergey Vojtovich wrote:
revision-id: f21705dfbfcd87e46937222eb860727beb21a89b (mariadb-10.1.8-66-gf21705d) parent(s): c0216f1d02e63686f986fa8f352fdf6de61249a7 committer: Sergey Vojtovich timestamp: 2015-11-17 13:13:47 +0400 message:
MDEV-7806 - thread_pool_size is not auto-sized
thread_pool_size is auto-sized before my_getopt(). But my_getopt starts from resetting all options to their default values. So the auto-sized value is lost.
Fixed by autosizing default value directly.
Strange solution. Why wouldn't you move autosizing after config variables are read?
Well, it's not a precedent: we already have similar solution for tc_log_size.
Wouldn't autosizing after config variables are read overwrite configured value? If so, we'll have to create special value for thread_pool_size, e.g. if value is 0 then do autosizing, preserve original value otherwise.
I think the preferred way is the one for tdc_size: ... read the options ... if (IS_SYSVAR_AUTOSIZE(&tdc_size)) SYSVAR_AUTOSIZE(tdc_size, MY_MIN(400 + tdc_size / 2, 2000)); if you'd like you can fix tc_log_size too :) Regards, Sergei
Hi Sergei, On Tue, Nov 17, 2015 at 03:22:23PM +0100, Sergei Golubchik wrote:
Hi, Sergey!
On Nov 17, Sergey Vojtovich wrote:
On Tue, Nov 17, 2015 at 02:23:56PM +0100, Sergei Golubchik wrote:
On Nov 17, Sergey Vojtovich wrote:
revision-id: f21705dfbfcd87e46937222eb860727beb21a89b (mariadb-10.1.8-66-gf21705d) parent(s): c0216f1d02e63686f986fa8f352fdf6de61249a7 committer: Sergey Vojtovich timestamp: 2015-11-17 13:13:47 +0400 message:
MDEV-7806 - thread_pool_size is not auto-sized
thread_pool_size is auto-sized before my_getopt(). But my_getopt starts from resetting all options to their default values. So the auto-sized value is lost.
Fixed by autosizing default value directly.
Strange solution. Why wouldn't you move autosizing after config variables are read?
Well, it's not a precedent: we already have similar solution for tc_log_size.
Wouldn't autosizing after config variables are read overwrite configured value? If so, we'll have to create special value for thread_pool_size, e.g. if value is 0 then do autosizing, preserve original value otherwise.
I think the preferred way is the one for tdc_size:
... read the options ... if (IS_SYSVAR_AUTOSIZE(&tdc_size)) SYSVAR_AUTOSIZE(tdc_size, MY_MIN(400 + tdc_size / 2, 2000));
if you'd like you can fix tc_log_size too :) Oh, you're right. I still have pre-origin image of sys_vars in my mind. Though I wonder what's the role of default value for autosized vars now?
Thanks, Sergey
Hi, Sergey! On Nov 17, Sergey Vojtovich wrote:
I think the preferred way is the one for tdc_size:
... read the options ... if (IS_SYSVAR_AUTOSIZE(&tdc_size)) SYSVAR_AUTOSIZE(tdc_size, MY_MIN(400 + tdc_size / 2, 2000));
if you'd like you can fix tc_log_size too :)
Oh, you're right. I still have pre-origin image of sys_vars in my mind. Though I wonder what's the role of default value for autosized vars now?
Not much. It might be used in SET @@var=default (I didn't test that :). It is surely visible in I_S.SYSTEM_VARIABLES. That's all. Auto-value is a function of the environment (and, in theory, all other variables). We could make that a default value, indeed. But then it'll need to be re-calculated for every SELECT * FROM I_S.SYSTEM_VARIABLES. This can be done consistently for all auto-sized variables, But it's more work than simply setting the default to the auto-value in mysqld.cc. Regards, Sergei Chief Architect MariaDB and security@mariadb.org
participants (2)
-
Sergei Golubchik
-
Sergey Vojtovich