From 6ad8d9b3f803f7bbde25f07c8d6a57d8ab47d275 Mon Sep 17 00:00:00 2001 From: Valmik Date: Mon, 7 Nov 2016 17:23:17 +0530 Subject: [PATCH] Set innodb buffer in production setup (#331) --- .../production/includes/setup_prod_env.yml | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/playbooks/production/includes/setup_prod_env.yml b/playbooks/production/includes/setup_prod_env.yml index a61578ba..ffa00c20 100755 --- a/playbooks/production/includes/setup_prod_env.yml +++ b/playbooks/production/includes/setup_prod_env.yml @@ -78,6 +78,28 @@ become: yes become_user: root + ###################################################### + # Set InnoDB Buffer Pool size to half of total RAM + - name: Set InnoDB buffer pool + lineinfile: > + dest=/etc/my.cnf.d/frappe.cnf + regexp="^\[mysqld\]$" + line="[mysqld]\ninnodb_buffer_pool_size={{ (ansible_memtotal_mb/2)|round|int }}M" + state=present + when: ansible_distribution == 'CentOS' + become: yes + become_user: root + + - name: Set InnoDB buffer pool + lineinfile: > + dest=/etc/mysql/conf.d/frappe.cnf + regexp="^\[mysqld\]$" + line="[mysqld]\ninnodb_buffer_pool_size={{ (ansible_memtotal_mb/2)|round|int }}M" + state=present + when: ansible_distribution == 'Ubuntu' or ansible_distribution == 'Debian' + become: yes + become_user: root + #################################################### # Enable nginx, mysql, redis and supevisord services - name: Enable nginx, mysql, and redis