Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: Tries to submit multiple aio page read requests together to improve read performance. This code adds an array to buffer aio requests in os_aio_array_t. So far only os_aio_read_array uses it. A new parameter (should_buffer) is added to indicate whether an aio request should be buffered or submitted. If should_submit is true, it will submit all bufferred aio requests on the os_aio_array. Only buf_read_ahead_linear is modified to utilize this functionality so far. All other call sites are setting should_submit to true. Other os_aio_array_t arrays will also ignore this. If one thread calling buf_read_ahead_linear is buffering io requests but another thread issues a normal os_aio_request, that other request will submit all the buffered requests from buf_read_ahead_linear. This is still better than nothing I suppose. Test Plan: Perf tests were run manually and approved by Yoshinori. Reviewers: steaphan, jtolmer, yoshinori, mcallaghan Reviewed By: steaphan, nizamordulu
- Loading branch information
1 parent
2783df6
commit f9d1a53
Showing
13 changed files
with
255 additions
and
33 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
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,30 @@ | ||
DROP TABLE if exists t1; | ||
CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b VARCHAR(256)) ENGINE=INNODB; | ||
INSERT INTO t1 VALUES (0, REPEAT('a',256)); | ||
INSERT INTO t1 SELECT 0, b FROM t1; | ||
INSERT INTO t1 SELECT 0, b FROM t1; | ||
INSERT INTO t1 SELECT 0, b FROM t1; | ||
INSERT INTO t1 SELECT 0, b FROM t1; | ||
INSERT INTO t1 SELECT 0, b FROM t1; | ||
INSERT INTO t1 SELECT 0, b FROM t1; | ||
INSERT INTO t1 SELECT 0, b FROM t1; | ||
INSERT INTO t1 SELECT 0, b FROM t1; | ||
INSERT INTO t1 SELECT 0, b FROM t1; | ||
INSERT INTO t1 SELECT 0, b FROM t1; | ||
INSERT INTO t1 SELECT 0, b FROM t1; | ||
INSERT INTO t1 SELECT 0, b FROM t1; | ||
INSERT INTO t1 SELECT 0, b FROM t1; | ||
INSERT INTO t1 SELECT 0, b FROM t1; | ||
INSERT INTO t1 SELECT 0, b FROM t1; | ||
INSERT INTO t1 SELECT 0, b FROM t1; | ||
show global status like "innodb_buffered_aio_submitted"; | ||
Variable_name Value | ||
Innodb_buffered_aio_submitted 0 | ||
select * from t1; | ||
select count(*) from t1; | ||
count(*) | ||
65536 | ||
show global status like "innodb_buffered_aio_submitted"; | ||
Variable_name Value | ||
Innodb_buffered_aio_submitted 1151 | ||
DROP TABLE t1; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
--source include/have_innodb.inc | ||
--source include/have_native_aio.inc | ||
|
||
--disable_warnings | ||
DROP TABLE if exists t1; | ||
--enable_warnings | ||
|
||
# Create table. | ||
CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b VARCHAR(256)) ENGINE=INNODB; | ||
|
||
# Populate table. | ||
INSERT INTO t1 VALUES (0, REPEAT('a',256)); | ||
INSERT INTO t1 SELECT 0, b FROM t1; | ||
INSERT INTO t1 SELECT 0, b FROM t1; | ||
INSERT INTO t1 SELECT 0, b FROM t1; | ||
INSERT INTO t1 SELECT 0, b FROM t1; | ||
INSERT INTO t1 SELECT 0, b FROM t1; | ||
INSERT INTO t1 SELECT 0, b FROM t1; | ||
INSERT INTO t1 SELECT 0, b FROM t1; | ||
INSERT INTO t1 SELECT 0, b FROM t1; | ||
INSERT INTO t1 SELECT 0, b FROM t1; | ||
INSERT INTO t1 SELECT 0, b FROM t1; | ||
INSERT INTO t1 SELECT 0, b FROM t1; | ||
INSERT INTO t1 SELECT 0, b FROM t1; | ||
INSERT INTO t1 SELECT 0, b FROM t1; | ||
INSERT INTO t1 SELECT 0, b FROM t1; | ||
INSERT INTO t1 SELECT 0, b FROM t1; | ||
INSERT INTO t1 SELECT 0, b FROM t1; | ||
|
||
--source include/restart_mysqld.inc | ||
|
||
show global status like "innodb_buffered_aio_submitted"; | ||
|
||
--disable_result_log | ||
select * from t1; | ||
--enable_result_log | ||
|
||
select count(*) from t1; | ||
|
||
show global status like "innodb_buffered_aio_submitted"; | ||
|
||
DROP TABLE t1; |
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
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
Oops, something went wrong.
likely typo in comment: read <-> ready