Optimize MySQL/InnoDB using NVDIMM
- Clone the source code:
$ git clone https://github.com/meeeejin/mysql-nvdimm-caching.git
- Change the value of
BASE_DIR
in thebuild.sh
file to the desired value:
$ vi build.sh
#!/bin/bash
BASE_DIR=/home/xxx/mysql-nvdimm-caching
...
- Run the script file:
$ ./build.sh
- Add the following three server variables to the
my.cnf
file:
System Variable | Description |
---|---|
innodb_use_nvdimm_buffer | Specifies whether to use NVDIMM cache. true or false. |
innodb_nvdimm_buffer_pool_size | The size in bytes of the NVDIMM cache. The default value is 2GB. |
innodb_nvdimm_buffer_pool_instances | The number of regions that the NVDIMM cache is divided into. The default value is 1. |
innodb_nvdimm_pc_threshold_pct | Wakeup the NVDIMM page cleaner when this % of free pages remaining. The default value is 5. |
For example:
$ vi my.cnf
...
innodb_use_nvdimm_buffer=true
innodb_nvdimm_buffer_pool_size=2G
innodb_nvdimm_buffer_pool_instances=1
innodb_nvdimm_pc_threshold_pct=5
...
- Run the MySQL server:
$ cd bld
$ ./bin/mysqld --defaults-file=my-nvdimm.cnf --disable-log-bin