kyongs / mysql8-tpcc-read-write-monitor

This project modifies mysql 8.0.28 code to monitor the read and write statistics of tpcc tables.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

mysql8-tpcc-read-write-monitor

This project modifies mysql 8.0.28 code to monitor the read and write statistics of tpcc tables.

Build/Installation

  1. MySQL 8.0.28 installation: To install mysql 8.0.28, please refer to link.
  2. TPC-C installation: To install tpcc, please refer to link.

Modified Files

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

How to change the buffer size

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
                               

Process

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;

스크린샷 2022-09-15 오후 12 46 34

스크린샷 2022-09-15 오후 12 46 23

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✈️

About

This project modifies mysql 8.0.28 code to monitor the read and write statistics of tpcc tables.


Languages

Language:C++ 77.7%Language:C 13.6%Language:Java 1.9%Language:NASL 1.1%Language:CMake 0.9%Language:Roff 0.9%Language:Makefile 0.8%Language:Objective-C 0.7%Language:Perl 0.6%Language:HTML 0.5%Language:Shell 0.4%Language:Yacc 0.3%Language:JavaScript 0.2%Language:Pascal 0.1%Language:PHP 0.1%Language:M4 0.0%Language:Starlark 0.0%Language:Assembly 0.0%Language:Python 0.0%Language:SWIG 0.0%Language:DIGITAL Command Language 0.0%Language:Awk 0.0%Language:Lex 0.0%Language:RPC 0.0%Language:Gnuplot 0.0%Language:Batchfile 0.0%Language:Pawn 0.0%Language:SourcePawn 0.0%Language:LLVM 0.0%Language:POV-Ray SDL 0.0%Language:CSS 0.0%Language:SAS 0.0%Language:Module Management System 0.0%Language:Dockerfile 0.0%Language:Visual Basic 6.0 0.0%Language:PLSQL 0.0%