-
Notifications
You must be signed in to change notification settings - Fork 713
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: This diff added a configurable variable to throttle the write rate of new innodb log file initialization. Default speed is 128MB/second, and setting it to 0 will turn off the throttling. I also changed the default value of innodb_fsync_freq to 1MB to reduce system stalls caused by fsyncing large trunks of file. Test Plan: jenkins Testing command: mysqld --datadir=/tmp/log_init --skip-grant-tables --skip-networking --socket=socket --innodb-log-file-size=1G --innodb-txlog-init-rate=[rate] With --innodb-txlog-init-rate=0 (no throttling, 1GB init finished in ~49s) 2015-05-22 16:51:20 4018018 [Note] InnoDB: Setting log file ./ib_logfile101 size to 1024 MB InnoDB: Progress in MB: 100 200 300 400 500 600 700 800 900 1000 2015-05-22 16:52:09 4018018 [Note] InnoDB: Setting log file ./ib_logfile1 size to 1024 MB InnoDB: Progress in MB: 100 200 300 400 500 600 700 800 900 1000 With --innodb-txlog-init-rate=10485760 (10MB/s throttling, 1GB log init finished in ~103s) 2015-05-22 16:55:28 4022136 [Note] InnoDB: Setting log file ./ib_logfile101 size to 1024 MB InnoDB: log file write is throttled at 10MB/s InnoDB: Progress in MB: 100 200 300 400 500 600 700 800 900 1000 2015-05-22 16:57:11 4022136 [Note] InnoDB: Setting log file ./ib_logfile1 size to 1024 MB InnoDB: log file write is throttled at 10MB/s InnoDB: Progress in MB: 100 200 300 400 500 600 700 800 900 1000 Without setting the option (use default. 1GB init finished in ~50s. Note the write is already below 128MB/s, so the throttling didn't have any effect) 2015-05-22 17:18:51 4055898 [Note] InnoDB: Setting log file ./ib_logfile101 size to 1024 MB InnoDB: log file write is throttled at 128MB/s InnoDB: Progress in MB: 100 200 300 400 500 600 700 800 900 1000 2015-05-22 17:19:41 4055898 [Note] InnoDB: Setting log file ./ib_logfile1 size to 1024 MB InnoDB: log file write is throttled at 128MB/s InnoDB: Progress in MB: 100 200 300 400 500 600 700 800 900 1000 Reviewers: jtolmer Reviewed By: jtolmer
- Loading branch information
Showing
6 changed files
with
84 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
mysql-test/suite/sys_vars/r/innodb_txlog_init_rate_basic.result
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
SET @orig_txlog_init_rate = @@global.innodb_txlog_init_rate; | ||
SELECT @orig_txlog_init_rate; | ||
@orig_txlog_init_rate | ||
134217728 | ||
SET GLOBAL innodb_txlog_init_rate = 500*1024*1024; | ||
SELECT @@global.innodb_txlog_init_rate; | ||
@@global.innodb_txlog_init_rate | ||
524288000 | ||
SET GLOBAL innodb_txlog_init_rate = 0; | ||
SELECT @@global.innodb_txlog_init_rate; | ||
@@global.innodb_txlog_init_rate | ||
0 | ||
SET GLOBAL innodb_txlog_init_rate = -1; | ||
Warnings: | ||
Warning 1292 Truncated incorrect innodb_txlog_init_rate value: '-1' | ||
SELECT @@global.innodb_txlog_init_rate; | ||
@@global.innodb_txlog_init_rate | ||
0 | ||
SET GLOBAL innodb_txlog_init_rate = 12345; | ||
Warnings: | ||
Warning 1292 Truncated incorrect innodb_txlog_init_rate value: '12345' | ||
SELECT @@global.innodb_txlog_init_rate; | ||
@@global.innodb_txlog_init_rate | ||
0 | ||
SET GLOBAL innodb_txlog_init_rate = @orig_txlog_init_rate; |
25 changes: 25 additions & 0 deletions
25
mysql-test/suite/sys_vars/t/innodb_txlog_init_rate_basic.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--source include/have_innodb.inc | ||
|
||
|
||
SET @orig_txlog_init_rate = @@global.innodb_txlog_init_rate; | ||
|
||
SELECT @orig_txlog_init_rate; | ||
|
||
# 500MB/s | ||
SET GLOBAL innodb_txlog_init_rate = 500*1024*1024; | ||
SELECT @@global.innodb_txlog_init_rate; | ||
|
||
# min value | ||
SET GLOBAL innodb_txlog_init_rate = 0; | ||
SELECT @@global.innodb_txlog_init_rate; | ||
|
||
# invalid value | ||
# too small | ||
SET GLOBAL innodb_txlog_init_rate = -1; | ||
SELECT @@global.innodb_txlog_init_rate; | ||
|
||
# not bound to page size | ||
SET GLOBAL innodb_txlog_init_rate = 12345; | ||
SELECT @@global.innodb_txlog_init_rate; | ||
|
||
SET GLOBAL innodb_txlog_init_rate = @orig_txlog_init_rate; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters