Top Nav

Change MySQL InnoDB Log File Size

Here’s my procedure for changing innodb_log_file_size:

  1. SET GLOBAL innodb_fast_shutdown = false;
  2. SET GLOBAL innodb_max_dirty_pages_pct = 0;
  3. /sbin/service mysqld restart
  4. /sbin/service mysqld stop
  5. rm -f /var/lib/mysql/ib_logfile[01]
  6. Edit /etc/my.cnf and set new value for innodb_log_file_size
  7. /sbin/service mysqld start

Here’s a handy sql command to determine a good log file size:

then do this:

to get the MB per minute. Set the log file size to be large enough to hold one hour of logs.

See http://www.mysqlperformanceblog.com/2008/11/21/how-to-calculate-a-good-innodb-log-file-size/ for the full discussion.