Thursday, October 7, 2021

Linux: Change swap file

 swapoff /dev/vg1/swap

lvextend -L +30GB /dev/vg1/swap

mkswap /dev/vg1/swap

swapon /dev/vg1/swap

MySQL: Increase InnoDB buffer cache memory allocation

 On each host (as root):


1. Backup the existing MySQL configuration:


cp /etc/my.cnf /etc/my.cnf.bak


2. Using vi, add the following parameters to /etc/my.cnf


[mysqld]

innodb_buffer_pool_size=100G

innodb_flush_method=O_DIRECT


3. Restart the MySQL database


service mysql55-mysqld restart

mysqladmin flush-hosts -p