diff options
author | Michael Widenius <monty@askmonty.org> | 2013-12-27 13:00:14 +0200 |
---|---|---|
committer | Michael Widenius <monty@askmonty.org> | 2013-12-27 13:00:14 +0200 |
commit | e41788d2b286bb9d76e972e57d2b476abd5efc86 (patch) | |
tree | 0704c35e9138260f93e5d6f1b1e82dba11e36614 /sql | |
parent | 02765f4c614069ece1f30976848b6299ba6f24bd (diff) | |
download | mariadb-git-e41788d2b286bb9d76e972e57d2b476abd5efc86.tar.gz |
Increased back_log to 150, but not more than max_connections.
- This was done to get better performance when doing a lot of connections.
Ensure that thread_cache_size is not larger than max_connections (trivial optimizations).
Fixed that the --host_cache_size=# startup option works
mysql-test/r/variables.result:
Increase back_log to 150
sql/hostname.cc:
Fixed that the --host_cache_size=# startup option works
sql/mysqld.cc:
Ensure that back_log and thread_cache_size is not set higher than max_connections (as this would not make any sense).
sql/sys_vars.cc:
Increased back_log to 150
Diffstat (limited to 'sql')
-rw-r--r-- | sql/hostname.cc | 2 | ||||
-rw-r--r-- | sql/mysqld.cc | 7 | ||||
-rw-r--r-- | sql/sys_vars.cc | 2 |
3 files changed, 9 insertions, 2 deletions
diff --git a/sql/hostname.cc b/sql/hostname.cc index 1200dd2c185..21e652a346f 100644 --- a/sql/hostname.cc +++ b/sql/hostname.cc @@ -149,7 +149,7 @@ bool hostname_cache_init() Host_entry tmp; uint key_offset= (uint) ((char*) (&tmp.ip_key) - (char*) &tmp); - if (!(hostname_cache= new hash_filo(HOST_CACHE_SIZE, + if (!(hostname_cache= new hash_filo(host_cache_size, key_offset, HOST_ENTRY_KEY_SIZE, NULL, (my_hash_free_key) free, &my_charset_bin))) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 5dbb3407428..b5e22c874f2 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -8943,6 +8943,13 @@ static int get_options(int *argc_ptr, char ***argv_ptr) max_binlog_size_var->option.def_value; } } + + /* Ensure that some variables are not set higher than needed */ + if (back_log > max_connections) + back_log= max_connections; + if (thread_cache_size > max_connections) + thread_cache_size= max_connections; + return 0; } diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index edd6e7b12a4..a1fa9a45e99 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -364,7 +364,7 @@ static Sys_var_ulong Sys_back_log( "MySQL can have. This comes into play when the main MySQL thread " "gets very many connection requests in a very short time", READ_ONLY GLOBAL_VAR(back_log), CMD_LINE(REQUIRED_ARG), - VALID_RANGE(1, 65535), DEFAULT(50), BLOCK_SIZE(1)); + VALID_RANGE(1, 65535), DEFAULT(150), BLOCK_SIZE(1)); static Sys_var_charptr Sys_basedir( "basedir", "Path to installation directory. All paths are " |