Note: Before testing the NV-PPL with the Linkbench Benchmark, loading the Linkbench data with Vanilla MySQL is needed to run the benchmark.
- Java
-
Install the latest JDK.
-
Move and decompress the downloaded file:
$ cd /usr/local
$ sudo mkdir java
$ cd java
$ sudo mv jdk-13.0.2_linux-x64_bin.tar.gz .
$ sudo tar -zxvf jdk-13.0.2_linux-x64_bin.tar.gz- (Optional) Register the java executables:
$ sudo update-alternatives --install /usr/bin/java java /usr/local/java/jdk-13.0.2/bin/java 1
$ sudo update-alternatives --install /usr/bin/javac javac /usr/local/java/jdk-13.0.2/bin/javac 1
$ sudo update-alternatives --install /usr/bin/javaws javaws /usr/local/java/jdk-13.0.2/bin/javaws 1If another version of Java is already installed, select the version of Java to use using below commands:
$ sudo update-alternatives --config java
$ sudo update-alternatives --config javac
$ sudo update-alternatives --config javaws- Add the three lines below (for setting the environment variables) to
/etc/profilefile:
$ sudo vi /etc/profile
...
export JAVA_HOME=/usr/local/java/jdk-13.0.2
export JRE_HOME=$JAVA_HOME/jre
export PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
$ . /etc/profile- Check the version of Java:
$ java -version
java version "13.0.2" 2020-01-14
Java(TM) SE Runtime Environment (build 13.0.2+8)
Java HotSpot(TM) 64-Bit Server VM (build 13.0.2+8, mixed mode, sharing)- Maven
$ sudo apt-get install maven- Clone the source code:
$ git clone https://github.com/facebookarchive/linkbench.git- Build LinkBench (skip all tests):
$ cd linkbench
$ mvn clean package -DskipTests- Start the MySQL server .
NOTE: If MySQL server is already on, skip this step.
$ cd mysql-57-nvdimm-ppl
$ ./bld/bin/mysqld --defaults-file=my-vanilla.cnf- Create a new database called
linkdband the needed tables:
$ ./bld/bin/mysql -uroot -pxxxx
mysql> create database linkdb;
mysql> use linkdb;
mysql> CREATE TABLE `linktable` (
`id1` bigint(20) unsigned NOT NULL DEFAULT '0',
`id2` bigint(20) unsigned NOT NULL DEFAULT '0',
`link_type` bigint(20) unsigned NOT NULL DEFAULT '0',
`visibility` tinyint(3) NOT NULL DEFAULT '0',
`data` varchar(255) NOT NULL DEFAULT '',
`time` bigint(20) unsigned NOT NULL DEFAULT '0',
`version` int(11) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (link_type, `id1`,`id2`),
KEY `id1_type` (`id1`,`link_type`,`visibility`,`time`,`id2`,`version`,`data`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 PARTITION BY key(id1) PARTITIONS 16;
CREATE TABLE `counttable` (
`id` bigint(20) unsigned NOT NULL DEFAULT '0',
`link_type` bigint(20) unsigned NOT NULL DEFAULT '0',
`count` int(10) unsigned NOT NULL DEFAULT '0',
`time` bigint(20) unsigned NOT NULL DEFAULT '0',
`version` bigint(20) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`id`,`link_type`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `nodetable` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`type` int(10) unsigned NOT NULL,
`version` bigint(20) unsigned NOT NULL,
`time` int(10) unsigned NOT NULL,
`data` mediumtext NOT NULL,
PRIMARY KEY(`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
mysql>quit;- Make a copy of the example config file:
$ cd linkbench
$ cp config/LinkConfigMysql.properties config/MyConfig.properties- Open
MyConfig.propertiesand change the MySQL connection information. For example:
# MySQL connection information
host = localhost
user = root
password = xxxx
port = 3306
dbid = linkdbIf you want to change the scale of the benchmark, open FBWorkload.properties and increase the value of maxid1 to get a larger database:
# start node id (inclusive)
startid1 = 1
# end node id for initial load (exclusive)
# With default config and MySQL/InnoDB, 50M ids ~= 64GB
maxid1 = 50000001- Load the data:
$ ./bin/linkbench -c config/MyConfig.properties -l- After Loading the data is finished, shut down the MySQL server:
$ cd mysql-57-nvdimm-ppl
$ ./bld/bin/mysqladmin -uroot -p shutdown- Pass your sudo password (PASSWD) as a first parameter of the build script and build with NV-PPL version:
$ cd mysql-57-nvdimm-ppl
$ sudo rm -rf bld
$ ./build.sh PASSWD --ppl- Open MyConfig.properties and modify the experiments variable
$ cd linkbench/config# number of threads to run during request phase
requesters = 32 #(32: # of cores in your machine)
# read + write requests per thread
requests = 781250 # 32 * 781250 = 25M Requests
# warmup time in seconds. The benchmark is run for a warmup period
warmup_time = 100- Modify the configuration file (
my.cnfin repository) for yourdata directory,log directoryandpersistent memory mount directory
$ cd mysql-57-nvdimm-ppl
$ vi my.cnf
default-storage-engine = innodb
skip-grant-tables
pid-file = /path/to/datadir/mysql.pid
socket = /tmp/mysql.sock
port = 3306
datadir = /path/to/datadir/
log-error = /path/to/logdir/mysql_error_nvdimm.log
innodb_log_group_home_dir=/path/to/logdir/
innodb_nvdimm_home_dir=/mnt/pmem
...- Start the NV-PPL server.
$ ./bld/bin/mysqld --defaults-file=my.cnf- Run the request phase:
$ cd linkbench
$ ./bin/linkbench -c config/MyConfig.properties -csvstats final-stats.csv -csvstream streaming-stats.csv -L linkbench-result.txt -r