diff --git a/host_vars/web3.dmz.mateu.be.yml b/host_vars/web3.dmz.mateu.be.yml index 34ee6cd..3762992 100644 --- a/host_vars/web3.dmz.mateu.be.yml +++ b/host_vars/web3.dmz.mateu.be.yml @@ -7,3 +7,6 @@ mariadb_root_pass: !vault | 65343238333661333765636131323962316637613036393366343161343162393337376232633432 3233653232353534370a393962663766623237313166333638343561306134663062333230333635 63343339363833626136646134353365393734346561613262633531386135366634 + +# 283M of base memory + 20MB/connection -> 1267M of RAM max +mariadb_max_connections: 50 diff --git a/roles/mariadb/defaults/main.yml b/roles/mariadb/defaults/main.yml index a598a8a..6e81ec7 100644 --- a/roles/mariadb/defaults/main.yml +++ b/roles/mariadb/defaults/main.yml @@ -2,3 +2,5 @@ mariadb_backup_hour: 5 mariadb_backup_minute: 0 + +mariadb_max_connections: 150 diff --git a/roles/mariadb/templates/50-server.cnf.j2 b/roles/mariadb/templates/50-server.cnf.j2 index da52017..f5d7629 100644 --- a/roles/mariadb/templates/50-server.cnf.j2 +++ b/roles/mariadb/templates/50-server.cnf.j2 @@ -33,16 +33,16 @@ bind-address = 127.0.0.1 # table_definition_cache = 800 -join_buffer_size = 512K +join_buffer_size = 1M key_buffer_size = 10M +max_connections = {{ mariadb_max_connections }} #max_allowed_packet = 1G #thread_stack = 192K #thread_cache_size = 8 # This replaces the startup script and checks MyISAM tables if needed # the first time they are touched #myisam_recover_options = BACKUP -#max_connections = 100 #table_cache = 64 # @@ -108,7 +108,8 @@ collation-server = utf8mb4_general_ci # Read the manual for more InnoDB related options. There are many! # Most important is to give InnoDB 80 % of the system RAM for buffer use: # https://mariadb.com/kb/en/innodb-system-variables/#innodb_buffer_pool_size -#innodb_buffer_pool_size = 8G +innodb_buffer_pool_size = 256M +innodb_log_file_size = 64M innodb_file_per_table innodb_data_file_path=ibdata1:10M:autoextend