This project modifies mysql 8.0.28 code to monitor the read and write statistics of tpcc tables.
- MySQL 8.0.28 installation: To install mysql 8.0.28, please refer to link.
- TPC-C installation: To install tpcc, please refer to link.
The major modifications are made in the following files. Type keyword kyong
to search the related modifications.
storage/innobase/include/srv0srv.h
storage/innobase/fil/fil0fil.cc
storage/innobase/srv/srv0srv.cc
storage/innobase/buf/buf0buf.cc
storage/innobase/buf/buf0flu.cc
storage/innobase/buf/buf0rea.cc
To change the buffer size in MySQL, you have to modify the my.cnf
. Change the line where #### CHANGE
is written. innodb_buffer_pool_size
is the buffer size related configuration.
#
# The MySQL database server configuration file
#
[client]
user = root
port = 3306
socket = /tmp/mysql.sock
[mysql]
prompt = \u:\d>\_
[mysqld_safe]
socket = /tmp/mysql.sock
[mysqld]
# Basic settings
default-storage-engine = innodb
pid-file = /home/vldb/data-disk/test-data/mysql.pid
socket = /tmp/mysql.sock
port = 3306
datadir = /home/vldb/data-disk/test-data/ #### CHANGE
log-error = /home/vldb/log-data/mysql_error.log #### CHANGE
log_error_verbosity = 3
disable_log_bin
#
# Innodb settings
#
# Page size
innodb_page_size=4KB
# Buffer pool settings
innodb_buffer_pool_size=7G ##### CHANGE
innodb_buffer_pool_instances=8
# Transaction log settings
innodb_log_file_size=1G
innodb_log_files_in_group=2
innodb_log_buffer_size=32M
# Log group path (iblog0, iblog1)
# If you separate the log device, uncomment and correct the path
innodb_log_group_home_dir=/home/vldb/log-data #### CHANGE
# Flush settings (SSD-optimized)
# 0: every 1 seconds, 1: fsync on commits, 2: writes on commits
innodb_flush_log_at_trx_commit=0
innodb_flush_neighbors=0
innodb_flush_method=O_DIRECT
1. Run MySQL source code.
$ cd /usr/local/mysql
$ ./bin/mysqld_safe --defaults-file=/usr/local/mysql/my.cnf
2. Run TPC-C.
$ cd ~/tpcc-mysql
$ ./tpcc_start -h 127.0.0.1 -S /tmp/mysql.sock -d tpcc -u root -p1234 -w {warehouse_num} -c {client_num} -r {rampup_time} -l {execution_time} | tee tpcc-result.txt
3. Monitor the InnoDB Status. The result will show like below.
$ cd /usr/local/mysql
$ ./bin/mysql -uroot -p
> SHOW ENGINE INNODB STATUS;
4. Collect the InnoDB status when the experiment ends, and calculate checkpoint flush rate.
Use excel or shell script to calculate specific statistics.
Please refer to the link to see the detailed results. link