Skip to content

meeeejin/mysql-nvdimm-caching

Repository files navigation

NVDIMM Caching for MySQL

Optimize MySQL/InnoDB using NVDIMM

Build and install

  1. Clone the source code:
$ git clone https://github.com/meeeejin/mysql-nvdimm-caching.git
  1. Change the value of BASE_DIR in the build.sh file to the desired value:
$ vi build.sh
#!/bin/bash

BASE_DIR=/home/xxx/mysql-nvdimm-caching
...
  1. Run the script file:
$ ./build.sh

Run

  1. 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
...
  1. Run the MySQL server:
$ cd bld
$ ./bin/mysqld --defaults-file=my-nvdimm.cnf --disable-log-bin