Skip to content
Snippets Groups Projects
Verified Commit 6534413c authored by Evangelos Foutras's avatar Evangelos Foutras :smiley_cat:
Browse files

mariadb: Tweak query cache settings

We used to set query_cache_type to 0 in the default settings but we were
also setting query_cache_size to a non-zero/non-default value, which was
in turn re-enabling the query cache. Update the configuration to reflect
the actual cache state and make sure query_cache_size is set to zero for
the "query_cache_type = 0" case.

Now that the setting controls the real state of the query cache, disable
it for bbs.archlinux.org; its hit rate is small compared to insert rate.
parent 1b2cfa71
No related branches found
No related tags found
No related merge requests found
Pipeline #10475 passed
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
- { role: root_ssh } - { role: root_ssh }
- { role: certbot } - { role: certbot }
- { role: nginx } - { role: nginx }
- { role: mariadb } - { role: mariadb, mariadb_query_cache_type: '0' }
- { role: sudo } - { role: sudo }
- { role: php_fpm, php_extensions: ['apcu', 'iconv', 'intl', 'mysqli'], zend_extensions: ['opcache'] } - { role: php_fpm, php_extensions: ['apcu', 'iconv', 'intl', 'mysqli'], zend_extensions: ['opcache'] }
- { role: fluxbb } - { role: fluxbb }
......
...@@ -9,7 +9,7 @@ mariadb_net_buffer_length: '8K' ...@@ -9,7 +9,7 @@ mariadb_net_buffer_length: '8K'
mariadb_read_buffer_size: '256K' mariadb_read_buffer_size: '256K'
mariadb_read_rnd_buffer_size: '512K' mariadb_read_rnd_buffer_size: '512K'
mariadb_myisam_sort_buffer_size: '8M' mariadb_myisam_sort_buffer_size: '8M'
mariadb_query_cache_type: '0' mariadb_query_cache_type: '1'
mariadb_query_cache_limit: '16M' mariadb_query_cache_limit: '16M'
mariadb_query_cache_size: '32M' mariadb_query_cache_size: '32M'
mariadb_max_connections: '400' mariadb_max_connections: '400'
......
...@@ -23,13 +23,19 @@ net_buffer_length = {{ mariadb_net_buffer_length }} ...@@ -23,13 +23,19 @@ net_buffer_length = {{ mariadb_net_buffer_length }}
read_buffer_size = {{ mariadb_read_buffer_size }} read_buffer_size = {{ mariadb_read_buffer_size }}
read_rnd_buffer_size = {{ mariadb_read_rnd_buffer_size }} read_rnd_buffer_size = {{ mariadb_read_rnd_buffer_size }}
myisam_sort_buffer_size = {{ mariadb_myisam_sort_buffer_size }} myisam_sort_buffer_size = {{ mariadb_myisam_sort_buffer_size }}
query_cache_type = {{ mariadb_query_cache_type }}
query_cache_limit = {{ mariadb_query_cache_limit }}
query_cache_size = {{ mariadb_query_cache_size }}
max_connections = {{ mariadb_max_connections }} max_connections = {{ mariadb_max_connections }}
thread_cache_size = {{ mariadb_thread_cache_size }} thread_cache_size = {{ mariadb_thread_cache_size }}
userstat = 1 userstat = 1
# Query cache settings
query_cache_type = {{ mariadb_query_cache_type }}
query_cache_limit = {{ mariadb_query_cache_limit }}
{% if mariadb_query_cache_type == '0' %}
query_cache_size = 0
{% else %}
query_cache_size = {{ mariadb_query_cache_size }}
{% endif %}
# Single server setup # Single server setup
server-id = 1 server-id = 1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment