-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug #18871046 SET NUMA MEMPOLICY FOR OPTIMUM MYSQLD PERFORMANCE
Problem: This is a contributed patch (bug#72811). The original contributor states that, "Historically, the suggested way to run MySQL on NUMA machines has been to run with "numactl --interleave=all" so that things like the InnoDB buffer pool are spread across all NUMA nodes." Currently InnoDB buffer pool is allocated without using NUMA features. Solution: Provide an option (--innodb_numa_interleave) to allocate InnoDB buffer pool using MPOL_INTERLEAVE memory policy of NUMA. What this patch does is the following: 1. If the option innodb_numa_interleave is enabled, then set the numa memory policy MPOL_INTERLEAVE for the mysqld process. 2. Allocate the buffer pool. 3. If the option innodb_numa_interleave is enabled, then set the numa memory policy back to MPOL_DEFAULT for the mysqld process. So all allocations that happen between 1 and 3 will be using the MPOL_INTERLEAVE memory policy. This is a basic patch to make InnoDB numa aware. More fine grained control is possible and will be taken up later. rb#7309 approved by allen.
- Loading branch information
Showing
10 changed files
with
106 additions
and
3 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
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,18 @@ | ||
let $numa_support = `SELECT COUNT(VARIABLE_VALUE) = 1 FROM | ||
INFORMATION_SCHEMA.GLOBAL_VARIABLES | ||
WHERE VARIABLE_NAME='innodb_numa_interleave'`; | ||
|
||
if ( $numa_support == 0 ) | ||
{ | ||
--skip Test requires: NUMA must be enabled | ||
} | ||
|
||
if ( $numa_support == 1 ) | ||
{ | ||
let $numa = `SELECT @@GLOBAL.innodb_numa_interleave = 'OFF'`; | ||
if ( $numa == 1 ) | ||
{ | ||
--skip Test requires: NUMA must be enabled | ||
} | ||
} | ||
|
10 changes: 10 additions & 0 deletions
10
mysql-test/suite/sys_vars/r/innodb_numa_interleave_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,10 @@ | ||
SELECT @@GLOBAL.innodb_numa_interleave; | ||
@@GLOBAL.innodb_numa_interleave | ||
1 | ||
SET @@GLOBAL.innodb_numa_interleave=off; | ||
ERROR HY000: Variable 'innodb_numa_interleave' is a read only variable | ||
SELECT @@GLOBAL.innodb_use_native_aio; | ||
@@GLOBAL.innodb_use_native_aio | ||
0 | ||
SELECT @@SESSION.innodb_use_native_aio; | ||
ERROR HY000: Variable 'innodb_use_native_aio' is a GLOBAL variable |
13 changes: 13 additions & 0 deletions
13
mysql-test/suite/sys_vars/t/innodb_numa_interleave_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,13 @@ | ||
--source include/have_innodb.inc | ||
--source include/have_numa.inc | ||
|
||
SELECT @@GLOBAL.innodb_numa_interleave; | ||
|
||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR | ||
SET @@GLOBAL.innodb_numa_interleave=off; | ||
|
||
SELECT @@GLOBAL.innodb_use_native_aio; | ||
|
||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR | ||
SELECT @@SESSION.innodb_use_native_aio; | ||
|
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