I am having MySQL database of size 1.3 GB on 8 core virtual machine, 8 GB of memory and I am having troubles optimizing the configuration. There is a lot of small rows and lot of joins going on.
I've found about this tool: https://tools.percona.com/wizard, but the differences it has suggested are only worsening the result. Primarily they suggest increasing InnoDB buffer pool to 6 GB. Currently I am having 1 GB buffer pool, but when I try to increase it, the performance is actually worse. Why is it happening?
Is there a way to force MySQL to cache the whole DB in memory, so it would not be stuck on such high levels of IO Wait?
The rest of the settings does not seem to make such difference.
Current state of my.cnf: https://gist.github.com/knyttl/ac6efe5c0730dd34a5cc
Looking at your my.cnf, you have defaults for many things. What you desperately need is a full Cleanup of the InnoDB Infrastructure. Click here to see the Pictorial Representation of the InnoDB Infrastructure.
STEP 01) Run this query
This will tell you how big to set innodb_buffer_pool_size (in MB).
Let's say that answer came up 1024.
STEP 02) Run this query
This will tell you how big to set key_buffer_size (in MB).
Let's say that answer came up 64.
STEP 03 : Run this query
This will perform a full transactional commit of any Transactions leftover in the Transaction Logs during the time of shutdown. The Transaction Logs are
/var/lib/mysql/ib_logfile0
/var/lib/mysql/ib_logfile1
STEP 04 : Dump all data out to a text file
STEP 05 : Shutdown MySQL
STEP 06 : Add the following to
my.cnf
If you are using MySQL 5.5 (or MySQL 5.1 with InnoDB Plugin Enabled), add these
If you are using MySQL 5.0, add these
Please note I chose innodb_log_file_size to 25% of innodb_buffer_pool_size
STEP 07 : Make room for new InnoDB Files
STEP 08 : Start MySQL
STEP 09 : Load the Data back
STEP 10 : If everything is running better, then run this:
All done with InnoDB Cleanup.
I have suggested InnoDB improvements like this many times before
Oct 29, 2010
: Howto: Clean a mysql InnoDB storage engine?Apr 13, 2011
: How to scale my.cnf settings and variables for move from 16GB server to 128GBFeb 03, 2012
: Scheduled optimization of tables in MySQL InnoDBMar 25, 2012
: Why does InnoDB store all databases in one file?Apr 01, 2012
: Is innodb_file_per_table advisable?Jul 20, 2012
: Reclaim disk space after deleting Magento MySQL databaseGive it a Try !!!