From 2d95514b5936e7ef9fce29183718814f5ea745d6 Mon Sep 17 00:00:00 2001 From: Mathias Ewald Date: Thu, 13 Oct 2016 20:23:11 +0200 Subject: [PATCH] Mariadb performance tuning Change-Id: Ic2b44de0ce8e8090318380a0fed3ff1bd51dc791 Closes-Bug: #1633178 --- ansible/roles/mariadb/templates/galera.cnf.j2 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ansible/roles/mariadb/templates/galera.cnf.j2 b/ansible/roles/mariadb/templates/galera.cnf.j2 index 3d7eb938e0..d74c74f29e 100644 --- a/ansible/roles/mariadb/templates/galera.cnf.j2 +++ b/ansible/roles/mariadb/templates/galera.cnf.j2 @@ -43,5 +43,15 @@ wsrep_notify_cmd=/usr/local/bin/wsrep-notify.sh max_connections=10000 +key_buffer_size = '64M' +max_heap_table_size = '64M' +tmp_table_size = '64M' +{% set dynamic_pool_size_mb = (hostvars[inventory_hostname]['ansible_memtotal_mb'] * 0.4) | round | int %} +{% if dynamic_pool_size_mb < 8192 %} +innodb_buffer_pool_size = '{{ dynamic_pool_size_mb }}M' +{% else %} +innodb_buffer_pool_size = '8192M' +{% endif %} + [server] pid-file=/var/lib/mysql/mariadb.pid