From: Tom Hughes Date: Mon, 16 Mar 2015 10:25:29 +0000 (+0000) Subject: Tune mysql for piwik X-Git-Url: https://git.openstreetmap.org./chef.git/commitdiff_plain/525ab3da99ed14a2bf1ec2969a8a60a43fe96af9 Tune mysql for piwik --- diff --git a/cookbooks/mysql/attributes/default.rb b/cookbooks/mysql/attributes/default.rb index e69de29bb..26ccd0368 100644 --- a/cookbooks/mysql/attributes/default.rb +++ b/cookbooks/mysql/attributes/default.rb @@ -0,0 +1 @@ +default[:mysql][:settings] = {} diff --git a/cookbooks/mysql/templates/default/my.cnf.erb b/cookbooks/mysql/templates/default/my.cnf.erb index a03aebc8d..7e445fa92 100644 --- a/cookbooks/mysql/templates/default/my.cnf.erb +++ b/cookbooks/mysql/templates/default/my.cnf.erb @@ -1 +1,8 @@ # DO NOT EDIT - This file is being maintained by Chef +<% node[:mysql][:settings].each do |section,settings| -%> + +[<%= section %>] +<% settings.each do |name, value| -%> +<%= name %> = <%= value %> +<% end -%> +<% end -%> diff --git a/roles/piwik.rb b/roles/piwik.rb index b15472dc8..a2badbc1a 100644 --- a/roles/piwik.rb +++ b/roles/piwik.rb @@ -4,6 +4,15 @@ description "Role applied to all Piwik servers" default_attributes( :apache => { :mpm => "prefork" + }, + :mysql => { + :settings => { + :mysqld => { + :innodb_buffer_pool_instances => "8", + :innodb_buffer_pool_size => "16GB", + :innodb_flush_log_at_trx_commit => "2" + } + } } )