/mysql-qps-demo

Primary LanguageHTMLMIT LicenseMIT

MySQL QPS Visualizer

This is a demo of using mysql's PERFORMANCE_SCHEMA table as a data source and visualizing the qps.

demo

qps_demo.mp4

Instructions

  1. start a mysql instance, probably using docker
# start mysql using docker
docker run -d -e MYSQL_ROOT_PASSWORD=pass --name mysql -p 3306:3306 mysql
  1. run sysbench workload
# create test database
mysql -u root -ppass -h 127.0.0.1 -e "create database if not exists sbtest;"
# insert test data
sysbench oltp_point_select --mysql-host=127.0.0.1 --mysql-user=root --mysql-password=pass --tables=1 --table-size=10000 --db-ps-mode=disable prepare
# run point get query workload
# note that we should specify option --db-ps-mode=disable, otherwise sysbench will use prepared statement to run benchmark test, which will not be caught by table performance_schema.events_statements_summary_by_digest
sysbench oltp_point_select --mysql-host=127.0.0.1 --mysql-user=root --mysql-password=pass --tables=1 --table-size=10000 --time=0 --report-interval=3 --db-ps-mode=disable run
  1. start demo server
make run
  1. watch the qps visualization

visit http://localhost:8080 to see the visualization live.