项目作者: meeeejin

项目描述 :
NVDIMM Caching for MySQL 5.7
高级语言: C++
项目地址: git://github.com/meeeejin/mysql-57-nvdimm-caching.git
创建时间: 2020-03-20T05:36:39Z
项目社区:https://github.com/meeeejin/mysql-57-nvdimm-caching

开源协议:GNU General Public License v2.0

下载


NVDIMM Caching for MySQL 5.7

Optimize MySQL/InnoDB using NVDIMM

Publication

Build and install

  1. Clone the source code:
  1. $ git clone https://github.com/meeeejin/mysql-57-nvdimm-caching.git
  1. Modify the PASSWD value in the build script:
  1. $ vi build.sh
  2. #!/bin/bash
  3. BASE_DIR=`pwd -P`
  4. BUILD_DIR=$BASE_DIR/bld
  5. PASSWD="sudo-passwd"
  6. ...
  1. Run the script file:
  1. $ ./build.sh

The above command will compile and build the source code with the default option (i.e., caching new-orders and order-line pages). The available options are:

Option Description
—origin No caching (Vanilla version)
—origin-monitor No caching but monitoring the flush status
—nc Caching New-Orders and Order-Line pages (default)
—nc-st Caching New-Orders, Order-Line and Stock pages
—nc-st-od Caching New-Orders, Order-Line, Stock and Orders pages
—mtr Caching New-Orders, Order-Line, Stock and Orders pages with mtr logging enabled

If you want the vanilla version, you can run the script as follows:

  1. $ ./build.sh --origin

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.
innodb_nvdimm_home_dir NVDIMM-aware files resident directory

For example:

  1. $ vi my.cnf
  2. ...
  3. innodb_use_nvdimm_buffer=true
  4. innodb_nvdimm_buffer_pool_size=2G
  5. innodb_nvdimm_buffer_pool_instances=1
  6. innodb_nvdimm_pc_threshold_pct=5
  7. innodb_nvdimm_home_dir=/mnt/pmem
  8. ...
  1. Run the MySQL server:
  1. $ ./bld/bin/mysqld --defaults-file=my.cnf