From 0f0e60275fee0737292e5329941e6af7b04e155c Mon Sep 17 00:00:00 2001 From: Chingis Sandanov Date: Mon, 21 Feb 2022 14:20:13 +0800 Subject: [PATCH] Rework default values in my.cnf, introduce new env vars #45 $MYSQL_LOWER_CASE_TABLE_NAMES, $MYSQL_JOIN_BUFFER_SIZE, $MYSQL_INNODB_OPEN_FILES no longer set by default unless specified $MYSQL_QUERY_CACHE_SIZE default value changed to 1M $MYSQL_QUERY_CACHE_TYPE now OFF by default $MYSQL_INNODB_FLUSH_LOG_AT_TRX_COMMIT default value changed to 1 Added new $MYSQL_JOIN_BUFFER_SPACE_LIMIT, $MYSQL_OPTIMIZER_SWITCH (no default values) Bugfix: $MYSQL_LOWER_CASE_TABLE_NAME changed to $MYSQL_LOWER_CASE_TABLE_NAMES --- 10/templates/10.2/my.cnf.tmpl | 28 ++++-- 10/templates/10.3/my.cnf.tmpl | 28 ++++-- 10/templates/10.4/my.cnf.tmpl | 24 +++-- 10/templates/10.5/my.cnf.tmpl | 24 +++-- 10/templates/10.6/my.cnf.tmpl | 24 +++-- README.md | 182 +++++++++++++++------------------- 6 files changed, 174 insertions(+), 136 deletions(-) diff --git a/10/templates/10.2/my.cnf.tmpl b/10/templates/10.2/my.cnf.tmpl index 892b3d8..a90f772 100644 --- a/10/templates/10.2/my.cnf.tmpl +++ b/10/templates/10.2/my.cnf.tmpl @@ -14,9 +14,9 @@ socket = /var/run/mysqld/mysqld.sock default-character-set = {{ getenv "MYSQL_CLIENT_DEFAULT_CHARACTER_SET" "utf8" }} [mariadb] -{{ if getenv "MARIADB_PLUGIN_LOAD" }} +{{- if getenv "MARIADB_PLUGIN_LOAD" }} plugin_load = {{ getenv "MARIADB_PLUGIN_LOAD" }} -{{ end }} +{{- end }} {{- if getenv "MARIADB_SSL_CERT" }} ssl_cert = {{ getenv "MARIADB_SSL_CERT" }} {{- end }} @@ -41,7 +41,9 @@ init_connect = '{{ getenv "MYSQL_INIT_CONNECT" "SET N character_set_server = {{ getenv "MYSQL_CHARACTER_SET_SERVER" "utf8" }} character_set_filesystem = {{ getenv "MYSQL_CHARACTER_SET_FILESYSTEM" "utf8" }} -lower_case_table_names = {{ getenv "MYSQL_LOWER_CASE_TABLE_NAME" "0" }} +{{- if getenv "MYSQL_LOWER_CASE_TABLE_NAME" }} +lower_case_table_names = {{ getenv "MYSQL_LOWER_CASE_TABLE_NAME" }} +{{- end }} symbolic-links = 0 default_storage_engine = {{ getenv "MYSQL_DEFAULT_STORAGE_ENGINE" "InnoDB" }} @@ -51,12 +53,17 @@ skip-name-resolve back_log = {{ getenv "MYSQL_BACK_LOG" "100" }} -join_buffer_size = {{ getenv "MYSQL_JOIN_BUFFER_SIZE" "8M" }} +{{- if getenv "MYSQL_JOIN_BUFFER_SIZE" }} +join_buffer_size = {{ getenv "MYSQL_JOIN_BUFFER_SIZE" }} +{{- end }} +{{- if getenv "MYSQL_JOIN_BUFFER_SPACE_LIMIT" }} +join_buffer_space_limit = {{ getenv "MYSQL_JOIN_BUFFER_SPACE_LIMIT" }} +{{- end }} max_heap_table_size = {{ getenv "MYSQL_MAX_HEAP_TABLE_SIZE" "16M" }} query_cache_limit = {{ getenv "MYSQL_QUERY_CACHE_LIMIT" "1M" }} query_cache_min_res_unit = {{ getenv "MYSQL_QUERY_CACHE_MIN_RES_UNIT" "4K" }} -query_cache_size = {{ getenv "MYSQL_QUERY_CACHE_SIZE" "128M" }} -query_cache_type = {{ getenv "MYSQL_QUERY_CACHE_TYPE" "ON" }} +query_cache_size = {{ getenv "MYSQL_QUERY_CACHE_SIZE" "1M" }} +query_cache_type = {{ getenv "MYSQL_QUERY_CACHE_TYPE" "OFF" }} sort_buffer_size = {{ getenv "MYSQL_SORT_BUFFER_SIZE" "2M" }} table_definition_cache = {{ getenv "MYSQL_TABLE_DEFINITION_CACHE" "400" }} table_open_cache = {{ getenv "MYSQL_TABLE_OPEN_CACHE" "4096" }} @@ -74,7 +81,7 @@ innodb_data_file_path = {{ getenv "MYSQL_INNODB_DATA_FILE_PATH innodb_default_row_format = {{ getenv "MYSQL_INNODB_DEFAULT_ROW_FORMAT" "dynamic" }} innodb_fast_shutdown = {{ getenv "MYSQL_INNODB_FAST_SHUTDOWN" "1" }} innodb_file_per_table = {{ getenv "MYSQL_INNODB_FILE_PER_TABLE" "1" }} -innodb_flush_log_at_trx_commit = {{ getenv "MYSQL_INNODB_FLUSH_LOG_AT_TRX_COMMIT" "2" }} +innodb_flush_log_at_trx_commit = {{ getenv "MYSQL_INNODB_FLUSH_LOG_AT_TRX_COMMIT" "1" }} innodb_flush_method = {{ getenv "MYSQL_INNODB_FLUSH_METHOD" "O_DIRECT" }} innodb_force_load_corrupted = {{ getenv "MYSQL_INNODB_FORCE_LOAD_CORRUPTED" "0" }} innodb_force_recovery = {{ getenv "MYSQL_INNODB_FORCE_RECOVERY" "0" }} @@ -84,7 +91,9 @@ innodb_log_buffer_size = {{ getenv "MYSQL_INNODB_LOG_BUFFER_SIZ innodb_log_file_size = {{ getenv "MYSQL_INNODB_LOG_FILE_SIZE" "128M" }} innodb_log_files_in_group = {{ getenv "MYSQL_INNODB_LOG_FILES_IN_GROUP" "2" }} innodb_old_blocks_time = {{ getenv "MYSQL_INNODB_OLD_BLOCKS_TIME" "1000" }} -innodb_open_files = {{ getenv "MYSQL_INNODB_OPEN_FILES" "1024" }} +{{- if getenv "MYSQL_INNODB_OPEN_FILES" }} +innodb_open_files = {{ getenv "MYSQL_INNODB_OPEN_FILES" }} +{{- end }} innodb_purge_threads = {{ getenv "MYSQL_INNODB_PURGE_THREADS" "4" }} innodb_read_io_threads = {{ getenv "MYSQL_INNODB_READ_IO_THREADS" "4" }} innodb_stats_on_metadata = {{ getenv "MYSQL_INNODB_STATS_ON_METADATA" "OFF" }} @@ -108,5 +117,8 @@ relay_log_recovery = {{ getenv "MYSQL_RELAY_LOG_RECOVERY" " optimizer_prune_level = {{ getenv "MYSQL_OPTIMIZER_PRUNE_LEVEL" "1" }} optimizer_search_depth = {{ getenv "MYSQL_OPTIMIZER_SEARCH_DEPTH" "62" }} +{{- if getenv "MYSQL_OPTIMIZER_SWITCH" }} +optimizer_switch = {{ getenv "MYSQL_OPTIMIZER_SWITCH" }} +{{- end }} transaction-isolation = {{ getenv "MYSQL_TRANSACTION_ISOLATION" "REPEATABLE-READ" }} diff --git a/10/templates/10.3/my.cnf.tmpl b/10/templates/10.3/my.cnf.tmpl index 892b3d8..a90f772 100644 --- a/10/templates/10.3/my.cnf.tmpl +++ b/10/templates/10.3/my.cnf.tmpl @@ -14,9 +14,9 @@ socket = /var/run/mysqld/mysqld.sock default-character-set = {{ getenv "MYSQL_CLIENT_DEFAULT_CHARACTER_SET" "utf8" }} [mariadb] -{{ if getenv "MARIADB_PLUGIN_LOAD" }} +{{- if getenv "MARIADB_PLUGIN_LOAD" }} plugin_load = {{ getenv "MARIADB_PLUGIN_LOAD" }} -{{ end }} +{{- end }} {{- if getenv "MARIADB_SSL_CERT" }} ssl_cert = {{ getenv "MARIADB_SSL_CERT" }} {{- end }} @@ -41,7 +41,9 @@ init_connect = '{{ getenv "MYSQL_INIT_CONNECT" "SET N character_set_server = {{ getenv "MYSQL_CHARACTER_SET_SERVER" "utf8" }} character_set_filesystem = {{ getenv "MYSQL_CHARACTER_SET_FILESYSTEM" "utf8" }} -lower_case_table_names = {{ getenv "MYSQL_LOWER_CASE_TABLE_NAME" "0" }} +{{- if getenv "MYSQL_LOWER_CASE_TABLE_NAME" }} +lower_case_table_names = {{ getenv "MYSQL_LOWER_CASE_TABLE_NAME" }} +{{- end }} symbolic-links = 0 default_storage_engine = {{ getenv "MYSQL_DEFAULT_STORAGE_ENGINE" "InnoDB" }} @@ -51,12 +53,17 @@ skip-name-resolve back_log = {{ getenv "MYSQL_BACK_LOG" "100" }} -join_buffer_size = {{ getenv "MYSQL_JOIN_BUFFER_SIZE" "8M" }} +{{- if getenv "MYSQL_JOIN_BUFFER_SIZE" }} +join_buffer_size = {{ getenv "MYSQL_JOIN_BUFFER_SIZE" }} +{{- end }} +{{- if getenv "MYSQL_JOIN_BUFFER_SPACE_LIMIT" }} +join_buffer_space_limit = {{ getenv "MYSQL_JOIN_BUFFER_SPACE_LIMIT" }} +{{- end }} max_heap_table_size = {{ getenv "MYSQL_MAX_HEAP_TABLE_SIZE" "16M" }} query_cache_limit = {{ getenv "MYSQL_QUERY_CACHE_LIMIT" "1M" }} query_cache_min_res_unit = {{ getenv "MYSQL_QUERY_CACHE_MIN_RES_UNIT" "4K" }} -query_cache_size = {{ getenv "MYSQL_QUERY_CACHE_SIZE" "128M" }} -query_cache_type = {{ getenv "MYSQL_QUERY_CACHE_TYPE" "ON" }} +query_cache_size = {{ getenv "MYSQL_QUERY_CACHE_SIZE" "1M" }} +query_cache_type = {{ getenv "MYSQL_QUERY_CACHE_TYPE" "OFF" }} sort_buffer_size = {{ getenv "MYSQL_SORT_BUFFER_SIZE" "2M" }} table_definition_cache = {{ getenv "MYSQL_TABLE_DEFINITION_CACHE" "400" }} table_open_cache = {{ getenv "MYSQL_TABLE_OPEN_CACHE" "4096" }} @@ -74,7 +81,7 @@ innodb_data_file_path = {{ getenv "MYSQL_INNODB_DATA_FILE_PATH innodb_default_row_format = {{ getenv "MYSQL_INNODB_DEFAULT_ROW_FORMAT" "dynamic" }} innodb_fast_shutdown = {{ getenv "MYSQL_INNODB_FAST_SHUTDOWN" "1" }} innodb_file_per_table = {{ getenv "MYSQL_INNODB_FILE_PER_TABLE" "1" }} -innodb_flush_log_at_trx_commit = {{ getenv "MYSQL_INNODB_FLUSH_LOG_AT_TRX_COMMIT" "2" }} +innodb_flush_log_at_trx_commit = {{ getenv "MYSQL_INNODB_FLUSH_LOG_AT_TRX_COMMIT" "1" }} innodb_flush_method = {{ getenv "MYSQL_INNODB_FLUSH_METHOD" "O_DIRECT" }} innodb_force_load_corrupted = {{ getenv "MYSQL_INNODB_FORCE_LOAD_CORRUPTED" "0" }} innodb_force_recovery = {{ getenv "MYSQL_INNODB_FORCE_RECOVERY" "0" }} @@ -84,7 +91,9 @@ innodb_log_buffer_size = {{ getenv "MYSQL_INNODB_LOG_BUFFER_SIZ innodb_log_file_size = {{ getenv "MYSQL_INNODB_LOG_FILE_SIZE" "128M" }} innodb_log_files_in_group = {{ getenv "MYSQL_INNODB_LOG_FILES_IN_GROUP" "2" }} innodb_old_blocks_time = {{ getenv "MYSQL_INNODB_OLD_BLOCKS_TIME" "1000" }} -innodb_open_files = {{ getenv "MYSQL_INNODB_OPEN_FILES" "1024" }} +{{- if getenv "MYSQL_INNODB_OPEN_FILES" }} +innodb_open_files = {{ getenv "MYSQL_INNODB_OPEN_FILES" }} +{{- end }} innodb_purge_threads = {{ getenv "MYSQL_INNODB_PURGE_THREADS" "4" }} innodb_read_io_threads = {{ getenv "MYSQL_INNODB_READ_IO_THREADS" "4" }} innodb_stats_on_metadata = {{ getenv "MYSQL_INNODB_STATS_ON_METADATA" "OFF" }} @@ -108,5 +117,8 @@ relay_log_recovery = {{ getenv "MYSQL_RELAY_LOG_RECOVERY" " optimizer_prune_level = {{ getenv "MYSQL_OPTIMIZER_PRUNE_LEVEL" "1" }} optimizer_search_depth = {{ getenv "MYSQL_OPTIMIZER_SEARCH_DEPTH" "62" }} +{{- if getenv "MYSQL_OPTIMIZER_SWITCH" }} +optimizer_switch = {{ getenv "MYSQL_OPTIMIZER_SWITCH" }} +{{- end }} transaction-isolation = {{ getenv "MYSQL_TRANSACTION_ISOLATION" "REPEATABLE-READ" }} diff --git a/10/templates/10.4/my.cnf.tmpl b/10/templates/10.4/my.cnf.tmpl index 1218fce..6011a57 100644 --- a/10/templates/10.4/my.cnf.tmpl +++ b/10/templates/10.4/my.cnf.tmpl @@ -42,7 +42,9 @@ init_connect = '{{ getenv "MYSQL_INIT_CONNECT" "SET N character_set_server = {{ getenv "MYSQL_CHARACTER_SET_SERVER" "utf8" }} character_set_filesystem = {{ getenv "MYSQL_CHARACTER_SET_FILESYSTEM" "utf8" }} -lower_case_table_names = {{ getenv "MYSQL_LOWER_CASE_TABLE_NAME" "0" }} +{{- if getenv "MYSQL_LOWER_CASE_TABLE_NAME" }} +lower_case_table_names = {{ getenv "MYSQL_LOWER_CASE_TABLE_NAME" }} +{{- end }} symbolic-links = 0 {{- if getenv "WSREP_ON" }} @@ -56,12 +58,17 @@ skip-name-resolve back_log = {{ getenv "MYSQL_BACK_LOG" "100" }} -join_buffer_size = {{ getenv "MYSQL_JOIN_BUFFER_SIZE" "8M" }} +{{- if getenv "MYSQL_JOIN_BUFFER_SIZE" }} +join_buffer_size = {{ getenv "MYSQL_JOIN_BUFFER_SIZE" }} +{{- end }} +{{- if getenv "MYSQL_JOIN_BUFFER_SPACE_LIMIT" }} +join_buffer_space_limit = {{ getenv "MYSQL_JOIN_BUFFER_SPACE_LIMIT" }} +{{- end }} max_heap_table_size = {{ getenv "MYSQL_MAX_HEAP_TABLE_SIZE" "16M" }} query_cache_limit = {{ getenv "MYSQL_QUERY_CACHE_LIMIT" "1M" }} query_cache_min_res_unit = {{ getenv "MYSQL_QUERY_CACHE_MIN_RES_UNIT" "4K" }} -query_cache_size = {{ getenv "MYSQL_QUERY_CACHE_SIZE" "128M" }} -query_cache_type = {{ getenv "MYSQL_QUERY_CACHE_TYPE" "ON" }} +query_cache_size = {{ getenv "MYSQL_QUERY_CACHE_SIZE" "1M" }} +query_cache_type = {{ getenv "MYSQL_QUERY_CACHE_TYPE" "OFF" }} sort_buffer_size = {{ getenv "MYSQL_SORT_BUFFER_SIZE" "2M" }} table_definition_cache = {{ getenv "MYSQL_TABLE_DEFINITION_CACHE" "400" }} table_open_cache = {{ getenv "MYSQL_TABLE_OPEN_CACHE" "4096" }} @@ -82,7 +89,7 @@ innodb_file_per_table = {{ getenv "MYSQL_INNODB_FILE_PER_TABLE {{- if getenv "WSREP_ON" }} innodb_flush_log_at_trx_commit = {{ getenv "MYSQL_INNODB_FLUSH_LOG_AT_TRX_COMMIT" "0" }} {{- else }} -innodb_flush_log_at_trx_commit = {{ getenv "MYSQL_INNODB_FLUSH_LOG_AT_TRX_COMMIT" "2" }} +innodb_flush_log_at_trx_commit = {{ getenv "MYSQL_INNODB_FLUSH_LOG_AT_TRX_COMMIT" "1" }} {{- end }} innodb_flush_method = {{ getenv "MYSQL_INNODB_FLUSH_METHOD" "O_DIRECT" }} innodb_force_load_corrupted = {{ getenv "MYSQL_INNODB_FORCE_LOAD_CORRUPTED" "0" }} @@ -93,7 +100,9 @@ innodb_log_buffer_size = {{ getenv "MYSQL_INNODB_LOG_BUFFER_SIZ innodb_log_file_size = {{ getenv "MYSQL_INNODB_LOG_FILE_SIZE" "128M" }} innodb_log_files_in_group = {{ getenv "MYSQL_INNODB_LOG_FILES_IN_GROUP" "2" }} innodb_old_blocks_time = {{ getenv "MYSQL_INNODB_OLD_BLOCKS_TIME" "1000" }} -innodb_open_files = {{ getenv "MYSQL_INNODB_OPEN_FILES" "1024" }} +{{- if getenv "MYSQL_INNODB_OPEN_FILES" }} +innodb_open_files = {{ getenv "MYSQL_INNODB_OPEN_FILES" }} +{{- end }} innodb_purge_threads = {{ getenv "MYSQL_INNODB_PURGE_THREADS" "4" }} innodb_read_io_threads = {{ getenv "MYSQL_INNODB_READ_IO_THREADS" "4" }} innodb_stats_on_metadata = {{ getenv "MYSQL_INNODB_STATS_ON_METADATA" "OFF" }} @@ -117,6 +126,9 @@ relay_log_recovery = {{ getenv "MYSQL_RELAY_LOG_RECOVERY" " optimizer_prune_level = {{ getenv "MYSQL_OPTIMIZER_PRUNE_LEVEL" "1" }} optimizer_search_depth = {{ getenv "MYSQL_OPTIMIZER_SEARCH_DEPTH" "62" }} +{{- if getenv "MYSQL_OPTIMIZER_SWITCH" }} +optimizer_switch = {{ getenv "MYSQL_OPTIMIZER_SWITCH" }} +{{- end }} transaction-isolation = {{ getenv "MYSQL_TRANSACTION_ISOLATION" "REPEATABLE-READ" }} {{- if getenv "WSREP_ON" }} diff --git a/10/templates/10.5/my.cnf.tmpl b/10/templates/10.5/my.cnf.tmpl index eaac513..da77aa4 100644 --- a/10/templates/10.5/my.cnf.tmpl +++ b/10/templates/10.5/my.cnf.tmpl @@ -42,7 +42,9 @@ init_connect = '{{ getenv "MYSQL_INIT_CONNECT" "SET N character_set_server = {{ getenv "MYSQL_CHARACTER_SET_SERVER" "utf8mb4" }} character_set_filesystem = {{ getenv "MYSQL_CHARACTER_SET_FILESYSTEM" "binary" }} -lower_case_table_names = {{ getenv "MYSQL_LOWER_CASE_TABLE_NAME" "0" }} +{{- if getenv "MYSQL_LOWER_CASE_TABLE_NAME" }} +lower_case_table_names = {{ getenv "MYSQL_LOWER_CASE_TABLE_NAME" }} +{{- end }} symbolic-links = 0 {{- if getenv "WSREP_ON" }} @@ -56,12 +58,17 @@ skip-name-resolve back_log = {{ getenv "MYSQL_BACK_LOG" "100" }} -join_buffer_size = {{ getenv "MYSQL_JOIN_BUFFER_SIZE" "8M" }} +{{- if getenv "MYSQL_JOIN_BUFFER_SIZE" }} +join_buffer_size = {{ getenv "MYSQL_JOIN_BUFFER_SIZE" }} +{{- end }} +{{- if getenv "MYSQL_JOIN_BUFFER_SPACE_LIMIT" }} +join_buffer_space_limit = {{ getenv "MYSQL_JOIN_BUFFER_SPACE_LIMIT" }} +{{- end }} max_heap_table_size = {{ getenv "MYSQL_MAX_HEAP_TABLE_SIZE" "16M" }} query_cache_limit = {{ getenv "MYSQL_QUERY_CACHE_LIMIT" "1M" }} query_cache_min_res_unit = {{ getenv "MYSQL_QUERY_CACHE_MIN_RES_UNIT" "4K" }} -query_cache_size = {{ getenv "MYSQL_QUERY_CACHE_SIZE" "128M" }} -query_cache_type = {{ getenv "MYSQL_QUERY_CACHE_TYPE" "ON" }} +query_cache_size = {{ getenv "MYSQL_QUERY_CACHE_SIZE" "1M" }} +query_cache_type = {{ getenv "MYSQL_QUERY_CACHE_TYPE" "OFF" }} sort_buffer_size = {{ getenv "MYSQL_SORT_BUFFER_SIZE" "2M" }} table_definition_cache = {{ getenv "MYSQL_TABLE_DEFINITION_CACHE" "400" }} table_open_cache = {{ getenv "MYSQL_TABLE_OPEN_CACHE" "4096" }} @@ -82,7 +89,7 @@ innodb_file_per_table = {{ getenv "MYSQL_INNODB_FILE_PER_TABLE {{- if getenv "WSREP_ON" }} innodb_flush_log_at_trx_commit = {{ getenv "MYSQL_INNODB_FLUSH_LOG_AT_TRX_COMMIT" "0" }} {{- else }} -innodb_flush_log_at_trx_commit = {{ getenv "MYSQL_INNODB_FLUSH_LOG_AT_TRX_COMMIT" "2" }} +innodb_flush_log_at_trx_commit = {{ getenv "MYSQL_INNODB_FLUSH_LOG_AT_TRX_COMMIT" "1" }} {{- end }} innodb_flush_method = {{ getenv "MYSQL_INNODB_FLUSH_METHOD" "O_DIRECT" }} innodb_force_load_corrupted = {{ getenv "MYSQL_INNODB_FORCE_LOAD_CORRUPTED" "0" }} @@ -93,7 +100,9 @@ innodb_log_buffer_size = {{ getenv "MYSQL_INNODB_LOG_BUFFER_SIZ innodb_log_file_size = {{ getenv "MYSQL_INNODB_LOG_FILE_SIZE" "128M" }} innodb_log_files_in_group = {{ getenv "MYSQL_INNODB_LOG_FILES_IN_GROUP" "2" }} innodb_old_blocks_time = {{ getenv "MYSQL_INNODB_OLD_BLOCKS_TIME" "1000" }} -innodb_open_files = {{ getenv "MYSQL_INNODB_OPEN_FILES" "1024" }} +{{- if getenv "MYSQL_INNODB_OPEN_FILES" }} +innodb_open_files = {{ getenv "MYSQL_INNODB_OPEN_FILES" }} +{{- end }} innodb_purge_threads = {{ getenv "MYSQL_INNODB_PURGE_THREADS" "4" }} innodb_read_io_threads = {{ getenv "MYSQL_INNODB_READ_IO_THREADS" "4" }} innodb_stats_on_metadata = {{ getenv "MYSQL_INNODB_STATS_ON_METADATA" "OFF" }} @@ -117,6 +126,9 @@ relay_log_recovery = {{ getenv "MYSQL_RELAY_LOG_RECOVERY" " optimizer_prune_level = {{ getenv "MYSQL_OPTIMIZER_PRUNE_LEVEL" "1" }} optimizer_search_depth = {{ getenv "MYSQL_OPTIMIZER_SEARCH_DEPTH" "62" }} +{{- if getenv "MYSQL_OPTIMIZER_SWITCH" }} +optimizer_switch = {{ getenv "MYSQL_OPTIMIZER_SWITCH" }} +{{- end }} transaction-isolation = {{ getenv "MYSQL_TRANSACTION_ISOLATION" "REPEATABLE-READ" }} {{- if getenv "WSREP_ON" }} diff --git a/10/templates/10.6/my.cnf.tmpl b/10/templates/10.6/my.cnf.tmpl index eaac513..d6449c0 100644 --- a/10/templates/10.6/my.cnf.tmpl +++ b/10/templates/10.6/my.cnf.tmpl @@ -42,7 +42,9 @@ init_connect = '{{ getenv "MYSQL_INIT_CONNECT" "SET N character_set_server = {{ getenv "MYSQL_CHARACTER_SET_SERVER" "utf8mb4" }} character_set_filesystem = {{ getenv "MYSQL_CHARACTER_SET_FILESYSTEM" "binary" }} -lower_case_table_names = {{ getenv "MYSQL_LOWER_CASE_TABLE_NAME" "0" }} +{{- if getenv "MYSQL_LOWER_CASE_TABLE_NAMES" }} +lower_case_table_names = {{ getenv "MYSQL_LOWER_CASE_TABLE_NAMES" }} +{{- end }} symbolic-links = 0 {{- if getenv "WSREP_ON" }} @@ -56,12 +58,17 @@ skip-name-resolve back_log = {{ getenv "MYSQL_BACK_LOG" "100" }} -join_buffer_size = {{ getenv "MYSQL_JOIN_BUFFER_SIZE" "8M" }} +{{- if getenv "MYSQL_JOIN_BUFFER_SIZE" }} +join_buffer_size = {{ getenv "MYSQL_JOIN_BUFFER_SIZE" }} +{{- end }} +{{- if getenv "MYSQL_JOIN_BUFFER_SPACE_LIMIT" }} +join_buffer_space_limit = {{ getenv "MYSQL_JOIN_BUFFER_SPACE_LIMIT" }} +{{- end }} max_heap_table_size = {{ getenv "MYSQL_MAX_HEAP_TABLE_SIZE" "16M" }} query_cache_limit = {{ getenv "MYSQL_QUERY_CACHE_LIMIT" "1M" }} query_cache_min_res_unit = {{ getenv "MYSQL_QUERY_CACHE_MIN_RES_UNIT" "4K" }} -query_cache_size = {{ getenv "MYSQL_QUERY_CACHE_SIZE" "128M" }} -query_cache_type = {{ getenv "MYSQL_QUERY_CACHE_TYPE" "ON" }} +query_cache_size = {{ getenv "MYSQL_QUERY_CACHE_SIZE" "1M" }} +query_cache_type = {{ getenv "MYSQL_QUERY_CACHE_TYPE" "OFF" }} sort_buffer_size = {{ getenv "MYSQL_SORT_BUFFER_SIZE" "2M" }} table_definition_cache = {{ getenv "MYSQL_TABLE_DEFINITION_CACHE" "400" }} table_open_cache = {{ getenv "MYSQL_TABLE_OPEN_CACHE" "4096" }} @@ -82,7 +89,7 @@ innodb_file_per_table = {{ getenv "MYSQL_INNODB_FILE_PER_TABLE {{- if getenv "WSREP_ON" }} innodb_flush_log_at_trx_commit = {{ getenv "MYSQL_INNODB_FLUSH_LOG_AT_TRX_COMMIT" "0" }} {{- else }} -innodb_flush_log_at_trx_commit = {{ getenv "MYSQL_INNODB_FLUSH_LOG_AT_TRX_COMMIT" "2" }} +innodb_flush_log_at_trx_commit = {{ getenv "MYSQL_INNODB_FLUSH_LOG_AT_TRX_COMMIT" "1" }} {{- end }} innodb_flush_method = {{ getenv "MYSQL_INNODB_FLUSH_METHOD" "O_DIRECT" }} innodb_force_load_corrupted = {{ getenv "MYSQL_INNODB_FORCE_LOAD_CORRUPTED" "0" }} @@ -93,7 +100,9 @@ innodb_log_buffer_size = {{ getenv "MYSQL_INNODB_LOG_BUFFER_SIZ innodb_log_file_size = {{ getenv "MYSQL_INNODB_LOG_FILE_SIZE" "128M" }} innodb_log_files_in_group = {{ getenv "MYSQL_INNODB_LOG_FILES_IN_GROUP" "2" }} innodb_old_blocks_time = {{ getenv "MYSQL_INNODB_OLD_BLOCKS_TIME" "1000" }} -innodb_open_files = {{ getenv "MYSQL_INNODB_OPEN_FILES" "1024" }} +{{- if getenv "MYSQL_INNODB_OPEN_FILES" }} +innodb_open_files = {{ getenv "MYSQL_INNODB_OPEN_FILES" }} +{{- end }} innodb_purge_threads = {{ getenv "MYSQL_INNODB_PURGE_THREADS" "4" }} innodb_read_io_threads = {{ getenv "MYSQL_INNODB_READ_IO_THREADS" "4" }} innodb_stats_on_metadata = {{ getenv "MYSQL_INNODB_STATS_ON_METADATA" "OFF" }} @@ -117,6 +126,9 @@ relay_log_recovery = {{ getenv "MYSQL_RELAY_LOG_RECOVERY" " optimizer_prune_level = {{ getenv "MYSQL_OPTIMIZER_PRUNE_LEVEL" "1" }} optimizer_search_depth = {{ getenv "MYSQL_OPTIMIZER_SEARCH_DEPTH" "62" }} +{{- if getenv "MYSQL_OPTIMIZER_SWITCH" }} +optimizer_switch = {{ getenv "MYSQL_OPTIMIZER_SWITCH" }} +{{- end }} transaction-isolation = {{ getenv "MYSQL_TRANSACTION_ISOLATION" "REPEATABLE-READ" }} {{- if getenv "WSREP_ON" }} diff --git a/README.md b/README.md index 798e230..2ac4eb0 100644 --- a/README.md +++ b/README.md @@ -29,79 +29,82 @@ All images built for `linux/amd64` ## Environment Variables -| Variable | 10.5 | 10.4 | 10.3 | 10.2 | -|------------------------------------------|----------------------|-------------------|-------------------|-------------------| -| [`MARIADB_PLUGIN_LOAD`] | | | | | -| [`MARIADB_SSL_CERT`] | | | | | -| [`MARIADB_SSL_KEY`] | | | | | -| [`MARIADB_SSL_CA`] | | | | | -| [`MARIADB_TLS_VERSION`] | `TLSv1.2,TLSv1.3` | `TLSv1.2,TLSv1.3` | | | -| [`MYSQL_BACK_LOG`] | `100` | `100` | `100` | `100` | -| [`MYSQL_CHARACTER_SET_FILESYSTEM`] | `binary` | `utf8` | `utf8` | `utf8` | -| [`MYSQL_CHARACTER_SET_SERVER`] | `utf8mb4` | `utf8` | `utf8` | `utf8` | -| `MYSQL_CLIENT_DEFAULT_CHARACTER_SET` | `utf8mb4` | `utf8` | `utf8` | `utf8` | -| [`MYSQL_COLLATION_SERVER`] | `utf8mb4_unicode_ci` | `utf8_unicode_ci` | `utf8_unicode_ci` | `utf8_unicode_ci` | -| [`MYSQL_CONNECT_TIMEOUT`] | `10` | `10` | `10` | `10` | -| `MYSQL_DATABASE` | | | | | -| [`MYSQL_DEFAULT_STORAGE_ENGINE`] | `InnoDB` | `InnoDB` | `InnoDB` | `InnoDB` | -| `MYSQL_DUMP_MAX_ALLOWED_PACKET` | `1G` | `1G` | `1G` | `1G` | -| [`MYSQL_GENERAL_LOG`] | `1` | `1` | `1` | `1` | -| [`MYSQL_INIT_CONNECT`] | `SET NAMES utf8` | `SET NAMES utf8` | `SET NAMES utf8` | `SET NAMES utf8` | -| [`MYSQL_INNODB_BUFFER_POOL_INSTANCES`] | `1` | `1` | `1` | `1` | -| [`MYSQL_INNODB_BUFFER_POOL_SIZE`] | `128M` | `128M` | `128M` | `128M` | -| [`MYSQL_INNODB_DEFAULT_ROW_FORMAT`] | `dynamic` | `dynamic` | `dynamic` | `dynamic` | -| [`MYSQL_INNODB_FAST_SHUTDOWN`] | `1` | `1` | `1` | `1` | -| [`MYSQL_INNODB_FILE_FORMAT`] | `-` | `-` | `-` | `-` | -| [`MYSQL_INNODB_FILE_PER_TABLE`] | `1` | `1` | `1` | `1` | -| [`MYSQL_INNODB_FLUSH_LOG_AT_TRX_COMMIT`] | `2` | `2` | `2` | `2` | -| [`MYSQL_INNODB_FLUSH_METHOD`] | `O_DIRECT` | `O_DIRECT` | `O_DIRECT` | `O_DIRECT` | -| [`MYSQL_INNODB_FORCE_LOAD_CORRUPTED`] | `0` | `0` | `0` | `0` | -| [`MYSQL_INNODB_FORCE_RECOVERY`] | `0` | `0` | `0` | `0` | -| [`MYSQL_INNODB_IO_CAPACITY`] | `200` | `200` | `200` | `200` | -| [`MYSQL_INNODB_LARGE_PREFIX`] | `-` | `-` | `-` | `-` | -| [`MYSQL_INNODB_LOCK_WAIT_TIMEOUT`] | `50` | `50` | `50` | `50` | -| [`MYSQL_INNODB_LOG_BUFFER_SIZE`] | `8M` | `8M` | `8M` | `8M` | -| [`MYSQL_INNODB_LOG_FILE_SIZE`] | `128M` | `128M` | `128M` | `128M` | -| [`MYSQL_INNODB_LOG_FILES_IN_GROUP`] | `2` | `2` | `2` | `2` | -| [`MYSQL_INNODB_OLD_BLOCKS_TIME`] | `1000` | `1000` | `1000` | `1000` | -| [`MYSQL_INNODB_OPEN_FILES`] | `1024` | `1024` | `1024` | `1024` | -| [`MYSQL_INNODB_PURGE_THREADS`] | `4` | `4` | `4` | `4` | -| [`MYSQL_INNODB_READ_IO_THREADS`] | `4` | `4` | `4` | `4` | -| [`MYSQL_INNODB_STATS_ON_METADATA`] | `OFF` | `OFF` | `OFF` | `OFF` | -| [`MYSQL_INNODB_STRICT_MODE`] | `OFF` | `OFF` | `OFF` | `OFF` | -| [`MYSQL_INNODB_WRITE_IO_THREADS`] | `4` | `4` | `4` | `4` | -| [`MYSQL_INTERACTIVE_TIMEOUT`] | `420` | `420` | `420` | `420` | -| [`MYSQL_JOIN_BUFFER_SIZE`] | `8M` | `8M` | `8M` | `8M` | -| [`MYSQL_LOG_WARNINGS`] | `2` | `2` | `2` | `2` | -| [`MYSQL_LONG_QUERY_TIME`] | `2` | `2` | `2` | `2` | -| [`MYSQL_LOWER_CASE_TABLE_NAME`] | `0` | `0` | `0` | `0` | -| [`MYSQL_MAX_ALLOWED_PACKET`] | `256M` | `256M` | `256M` | `256M` | -| [`MYSQL_MAX_CONNECT_ERRORS`] | `100000` | `100000` | `100000` | `100000` | -| [`MYSQL_MAX_CONNECTIONS`] | `50` | `50` | `50` | `50` | -| [`MYSQL_MAX_HEAP_TABLE_SIZE`] | `16M` | `16M` | `16M` | `16M` | -| [`MYSQL_NET_READ_TIMEOUT`] | `90` | `90` | `90` | `90` | -| [`MYSQL_NET_WRITE_TIMEOUT`] | `90` | `90` | `90` | `90` | -| [`MYSQL_OPEN_FILES_LIMIT`] | `0` | `0` | `0` | `0` | -| [`MYSQL_OPTIMIZER_PRUNE_LEVEL`] | `1` | `1` | `1` | `1` | -| [`MYSQL_OPTIMIZER_SEARCH_DEPTH`] | `62` | `62` | `62` | `62` | -| `MYSQL_PASSWORD` | | | | | -| [`MYSQL_PERFORMANCE_SCHEMA`] | `OFF` | `OFF` | `OFF` | `OFF` | -| `MYSQL_PORT` | `3306` | `3306` | `3306` | `3306` | -| [`MYSQL_QUERY_CACHE_LIMIT`] | `1M` | `1M` | `1M` | `1M` | -| [`MYSQL_QUERY_CACHE_MIN_RES_UNIT`] | `2K` | `2K` | `2K` | `2K` | -| [`MYSQL_QUERY_CACHE_SIZE`] | `128M` | `128M` | `128M` | `128M` | -| [`MYSQL_QUERY_CACHE_TYPE`] | `ON` | `ON` | `ON` | `ON` | -| [`MYSQL_RELAY_LOG_RECOVERY`] | `0` | `0` | `0` | `0` | -| `MYSQL_ROOT_PASSWORD` | | | | | -| [`MYSQL_SLOW_QUERY_LOG`] | `0` | `0` | `0` | `0` | -| [`MYSQL_SORT_BUFFER_SIZE`] | `2M` | `2M` | `2M` | `2M` | -| [`MYSQL_TABLE_DEFINITION_CACHE`] | `400` | `400` | `400` | `400` | -| [`MYSQL_TABLE_OPEN_CACHE`] | `4096` | `4096` | `4096` | `4096` | -| [`MYSQL_THREAD_CACHE_SIZE`] | `75` | `75` | `75` | `75` | -| [`MYSQL_TMP_TABLE_SIZE`] | `16M` | `16M` | `16M` | `16M` | -| `MYSQL_USER` | | | | | -| [`MYSQL_WAIT_TIMEOUT`] | `420` | `420` | `420` | `420` | -| [`MYSQL_TRANSACTION_ISOLATION`] | `REPEATABLE-READ` | `REPEATABLE-READ` | `REPEATABLE-READ` | `REPEATABLE-READ` | +| Variable | 10.6, 10.5, 10.4 | 10.3, 10.2 | +|------------------------------------------|----------------------|-------------------| +| [`MARIADB_PLUGIN_LOAD`] | | | +| [`MARIADB_SSL_CERT`] | | | +| [`MARIADB_SSL_KEY`] | | | +| [`MARIADB_SSL_CA`] | | | +| [`MARIADB_TLS_VERSION`] | `TLSv1.2,TLSv1.3` | | +| [`MYSQL_BACK_LOG`] | `100` | `100` | +| [`MYSQL_CHARACTER_SET_FILESYSTEM`] | `binary` | `utf8` | +| [`MYSQL_CHARACTER_SET_SERVER`] | `utf8mb4` | `utf8` | +| `MYSQL_CLIENT_DEFAULT_CHARACTER_SET` | `utf8mb4` | `utf8` | +| [`MYSQL_COLLATION_SERVER`] | `utf8mb4_unicode_ci` | `utf8_unicode_ci` | +| [`MYSQL_CONNECT_TIMEOUT`] | `10` | `10` | +| `MYSQL_DATABASE` | | | +| [`MYSQL_DEFAULT_STORAGE_ENGINE`] | `InnoDB` | `InnoDB` | +| `MYSQL_DUMP_MAX_ALLOWED_PACKET` | `1G` | `1G` | +| [`MYSQL_GENERAL_LOG`] | `1` | `1` | +| [`MYSQL_INIT_CONNECT`] | `SET NAMES utf8` | `SET NAMES utf8` | +| [`MYSQL_INNODB_BUFFER_POOL_INSTANCES`] | `1` | `1` | +| [`MYSQL_INNODB_BUFFER_POOL_SIZE`] | `128M` | `128M` | +| [`MYSQL_INNODB_DEFAULT_ROW_FORMAT`] | `dynamic` | `dynamic` | +| [`MYSQL_INNODB_FAST_SHUTDOWN`] | `1` | `1` | +| [`MYSQL_INNODB_FILE_FORMAT`] | `-` | `-` | +| [`MYSQL_INNODB_FILE_PER_TABLE`] | `1` | `1` | +| [`MYSQL_INNODB_FLUSH_LOG_AT_TRX_COMMIT`] | `2` | `2` | +| [`MYSQL_INNODB_FLUSH_METHOD`] | `O_DIRECT` | `O_DIRECT` | +| [`MYSQL_INNODB_FORCE_LOAD_CORRUPTED`] | `0` | `0` | +| [`MYSQL_INNODB_FORCE_RECOVERY`] | `0` | `0` | +| [`MYSQL_INNODB_IO_CAPACITY`] | `200` | `200` | +| [`MYSQL_INNODB_LARGE_PREFIX`] | `-` | `-` | +| [`MYSQL_INNODB_LOCK_WAIT_TIMEOUT`] | `50` | `50` | +| [`MYSQL_INNODB_LOG_BUFFER_SIZE`] | `8M` | `8M` | +| [`MYSQL_INNODB_LOG_FILE_SIZE`] | `128M` | `128M` | +| [`MYSQL_INNODB_LOG_FILES_IN_GROUP`] | `2` | `2` | +| [`MYSQL_INNODB_OLD_BLOCKS_TIME`] | `1000` | `1000` | +| [`MYSQL_INNODB_OPEN_FILES`] | | | +| [`MYSQL_INNODB_PURGE_THREADS`] | `4` | `4` | +| [`MYSQL_INNODB_READ_IO_THREADS`] | `4` | `4` | +| [`MYSQL_INNODB_STATS_ON_METADATA`] | `OFF` | `OFF` | +| [`MYSQL_INNODB_STRICT_MODE`] | `OFF` | `OFF` | +| [`MYSQL_INNODB_WRITE_IO_THREADS`] | `4` | `4` | +| [`MYSQL_INTERACTIVE_TIMEOUT`] | `420` | `420` | +| [`MYSQL_JOIN_BUFFER_SIZE`] | | | +| [`MYSQL_JOIN_BUFFER_SPACE_LIMIT`] | | | +| [`MYSQL_LOG_WARNINGS`] | `2` | `2` | +| [`MYSQL_LONG_QUERY_TIME`] | `2` | `2` | +| [`MYSQL_LOWER_CASE_TABLE_NAMES`] | | | +| [`MYSQL_MAX_ALLOWED_PACKET`] | `256M` | `256M` | +| [`MYSQL_MAX_CONNECT_ERRORS`] | `100000` | `100000` | +| [`MYSQL_MAX_CONNECTIONS`] | `50` | `50` | +| [`MYSQL_MAX_HEAP_TABLE_SIZE`] | `16M` | `16M` | +| [`MYSQL_NET_READ_TIMEOUT`] | `90` | `90` | +| [`MYSQL_NET_WRITE_TIMEOUT`] | `90` | `90` | +| [`MYSQL_OPEN_FILES_LIMIT`] | `0` | `0` | +| [`MYSQL_OPTIMIZER_PRUNE_LEVEL`] | `1` | `1` | +| [`MYSQL_OPTIMIZER_SEARCH_DEPTH`] | `62` | `62` | +| [`MYSQL_OPTIMIZER_SWITCH`] | | | +| `MYSQL_PASSWORD` | | | +| [`MYSQL_PERFORMANCE_SCHEMA`] | `OFF` | `OFF` | +| `MYSQL_PORT` | `3306` | `3306` | +| [`MYSQL_QUERY_CACHE_LIMIT`] | `1M` | `1M` | +| [`MYSQL_QUERY_CACHE_MIN_RES_UNIT`] | `2K` | `2K` | +| [`MYSQL_QUERY_CACHE_SIZE`] | `1M` | `1M` | +| [`MYSQL_QUERY_CACHE_TYPE`] | `OFF` | `OFF` | +| [`MYSQL_RELAY_LOG_RECOVERY`] | `0` | `0` | +| `MYSQL_ROOT_PASSWORD` | | | +| [`MYSQL_SLOW_QUERY_LOG`] | `0` | `0` | +| [`MYSQL_SORT_BUFFER_SIZE`] | `2M` | `2M` | +| [`MYSQL_TABLE_DEFINITION_CACHE`] | `400` | `400` | +| [`MYSQL_TABLE_OPEN_CACHE`] | `4096` | `4096` | +| [`MYSQL_THREAD_CACHE_SIZE`] | `75` | `75` | +| [`MYSQL_TMP_TABLE_SIZE`] | `16M` | `16M` | +| `MYSQL_USER` | | | +| [`MYSQL_WAIT_TIMEOUT`] | `420` | `420` | +| [`MYSQL_TRANSACTION_ISOLATION`] | `REPEATABLE-READ` | `REPEATABLE-READ` | + > "-" - Not available for this version ### Additional environment variables @@ -116,7 +119,7 @@ ibdata1:10M:autoextend:max:10G" ### Additional Galera environment variables -| Variable | 10.4-galera | +| Variable | Value | |------------------------------------------|--------------------| | [`WSREP_ON`] | `OFF` | | [`MYSQL_INNODB_FLUSH_LOG_AT_TRX_COMMIT`] | `0` | @@ -172,33 +175,6 @@ ibdata1:10M:autoextend:max:10G" | `default_storage_engine` | `InnoDB` | | `innodb_autoinc_lock_mode` | `2` | -## Performance Tuning Recommendations - -### Optimizer search depth - -Decrease the value of `MYSQL_OPTIMIZER_SEARCH_DEPTH` to 7-8 if you have many queries with more than 15 tables ([source](https://mariadb.com/resources/blog/setting-optimizer-search-depth-mysql)) - -### Calculating the optimal size of `innodb_buffer_pool_size` - -Run the following query to get the recommend innodb buffer pool size: - -```sql -SELECT CONCAT(CEILING(RIBPS/POWER(1024,pw)),SUBSTR(' KMGT',pw+1,1)) -Recommended_InnoDB_Buffer_Pool_Size FROM -( - SELECT RIBPS,FLOOR(LOG(RIBPS)/LOG(1024)) pw - FROM - ( - SELECT SUM(data_length+index_length)*1.1*growth RIBPS - FROM information_schema.tables AAA, - (SELECT 1.25 growth) BBB - WHERE ENGINE='InnoDB' - ) AA -) A; -``` - -Source: from [stack exchange](https://dba.stackexchange.com/a/27472/134547). - ## Galera Cluster ### Galera Cluster Documentation @@ -330,9 +306,10 @@ Deploy MariaDB to your own server via [![Wodby](https://www.google.com/s2/favico [`MYSQL_INNODB_WRITE_IO_THREADS`]: https://mariadb.com/kb/en/library/xtradbinnodb-server-system-variables#innodb_write_io_threads [`MYSQL_INTERACTIVE_TIMEOUT`]: https://mariadb.com/kb/en/library/server-system-variables#interactive_timeout [`MYSQL_JOIN_BUFFER_SIZE`]: https://mariadb.com/kb/en/library/server-system-variables#join_buffer_size +[`MYSQL_JOIN_BUFFER_SPACE_LIMIT`]: https://mariadb.com/kb/en/library/server-system-variables#join_buffer_space_limit [`MYSQL_LOG_WARNINGS`]: https://mariadb.com/kb/en/library/server-system-variables/#log_warnings [`MYSQL_LONG_QUERY_TIME`]: https://mariadb.com/kb/en/library/server-system-variables#long_query_time -[`MYSQL_LOWER_CASE_TABLE_NAME`]: https://mariadb.com/kb/en/server-system-variables/#lower_case_table_names +[`MYSQL_LOWER_CASE_TABLE_NAMES`]: https://mariadb.com/kb/en/server-system-variables/#lower_case_table_names [`MYSQL_MAX_ALLOWED_PACKET`]: https://mariadb.com/kb/en/library/server-system-variables#max_allowed_packet [`MYSQL_MAX_CONNECT_ERRORS`]: https://mariadb.com/kb/en/library/server-system-variables#max_connect_errors [`MYSQL_MAX_CONNECTIONS`]: https://mariadb.com/kb/en/library/server-system-variables#max_connections @@ -342,6 +319,7 @@ Deploy MariaDB to your own server via [![Wodby](https://www.google.com/s2/favico [`MYSQL_OPEN_FILES_LIMIT`]: https://mariadb.com/kb/en/library/server-system-variables/#open_files_limit [`MYSQL_OPTIMIZER_PRUNE_LEVEL`]: https://mariadb.com/kb/en/library/server-system-variables/#optimizer_prune_level [`MYSQL_OPTIMIZER_SEARCH_DEPTH`]: https://mariadb.com/kb/en/library/server-system-variables/#optimizer_search_depth +[`MYSQL_OPTIMIZER_SWITCH`]: https://mariadb.com/kb/en/library/server-system-variables/#optimizer_switch [`MYSQL_PERFORMANCE_SCHEMA`]: https://mariadb.com/kb/en/library/performance-schema-system-variables#performance_schema [`MYSQL_QUERY_CACHE_LIMIT`]: https://mariadb.com/kb/en/library/server-system-variables#query_cache_limit [`MYSQL_QUERY_CACHE_MIN_RES_UNIT`]: https://mariadb.com/kb/en/library/server-system-variables#query_cache_min_res_unit