FlashSQL / mysql-57-nvdimm-caching

NVDIMM Caching for MySQL 5.7

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NVDIMM Caching for MySQL 5.7

Optimize MySQL/InnoDB using NVDIMM

Build and install

  1. Clone the source code:
$ git clone https://github.com/meeeejin/mysql-57-nvdimm-caching.git
  1. Modify the PASSWD value in the build script:
$ vi build.sh

#!/bin/bash

BASE_DIR=`pwd -P`
BUILD_DIR=$BASE_DIR/bld
PASSWD="sudo-passwd"
...
  1. Run the script file:
$ ./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:

$ ./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:

$ 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
innodb_nvdimm_home_dir=/mnt/pmem
...
  1. Run the MySQL server:
$ ./bld/bin/mysqld --defaults-file=my.cnf

About

NVDIMM Caching for MySQL 5.7

License:GNU General Public License v2.0


Languages

Language:C++ 53.5%Language:C 21.2%Language:JavaScript 14.5%Language:Java 3.0%Language:CSS 1.8%Language:Perl 1.0%Language:Objective-C 0.8%Language:CMake 0.7%Language:PHP 0.6%Language:HTML 0.6%Language:Yacc 0.4%Language:NASL 0.4%Language:Assembly 0.4%Language:Shell 0.3%Language:Python 0.2%Language:Less 0.2%Language:Pascal 0.1%Language:Roff 0.1%Language:GAP 0.1%Language:Makefile 0.0%Language:XSLT 0.0%Language:DIGITAL Command Language 0.0%Language:SWIG 0.0%Language:ActionScript 0.0%Language:DTrace 0.0%Language:Lex 0.0%Language:RPC 0.0%Language:M4 0.0%Language:Emacs Lisp 0.0%Language:Awk 0.0%Language:Batchfile 0.0%Language:Vim Script 0.0%Language:POV-Ray SDL 0.0%Language:Pawn 0.0%Language:SAS 0.0%Language:Module Management System 0.0%Language:PLSQL 0.0%Language:VBA 0.0%