Introduction to the use of MySQL performance stress benchmark tool sysbench

Introduction to the use of MySQL performance stress benchmark tool sysbench

1. Introduction to sysbench

Here we introduce a MySQL database stress testing software sysbench, which is used for benchmark testing.

Sysbench is an open source, modular, cross-platform multi-threaded performance testing tool.

It can be used to perform performance tests on CPU, memory, disk I/O, threads, and databases.

Currently supported databases are MySQL, Oracle and PostgreSQL.

#Project download address:

https://launchpad.net/sysbench
http://github.com/akopytov/sysbench

The idea of ​​this benchmark suite is to quickly get an impression of system performance without having to set up a complex database benchmark or even having a database installed.
The current functionality allows testing of the following system parameters:

  • #CPU Performance
  • file I/O performance #File IO performance, disk IO performance
  • scheduler performance
  • memory allocation and transfer speed
  • POSIX threads implementation performance
  • database server performance (OLTP benchmark)

Sysbench's oltp is mainly used to evaluate and test the database load under various system parameters.
Compared with version 0.4, the subsequent versions of oltp testing mainly combine lua scripts. There is no need to modify the source code. Testing of different business types can be achieved through custom lua scripts.

Disadvantages of SysBench:
The simulated table structure is too simple, not as complete a transaction system as tpcc-mysql, but it is still very useful for MySQL performance stress testing comparison.

2. Sysbench installation process

#Install related dependencies

mount /dev/cdrom /mnt
yum -y install make automake libtool pkgconfig libaio-devel libtool

# Installation process starts

#Make a link to the client lib package ln -sf /mysql/app/mysql/lib/libmysqlclient.so.20 /usr/lib/libmysqlclient.so.20
#Unzip and install cd /softtar zxvf sysbench-1.0.15.tar.gz cd sysbench-1.0.15./autogen.sh
./configure --prefix=/mysql/app/sysbench --with-mysql=/mysql/app/mysql --with-mysql-includes=/mysql/app/mysql/include/
#--with-mysql-libs=/usr/lib/
make && make install
#Configure environment variables vi ~/.bash_profile
PATH=$PATH:/mysql/app/sysbench/bin:$HOME/bin
source ~/.bash_profile
sysbench --version
#If an error message is reported, sysbench: error while loading shared libraries: libmysqlclient.so.20: cannot open shared object file: No such file or directory

#Then add the line /usr/lib to /etc/ld.so.cnf [root@tse01 local]# cat /etc/ld.so.conf
include ld.so.conf.d/*.conf
/usr/lib/
#Execute ldconfig -v to update the configuration [root@tse01 local]# /sbin/ldconfig -v

# Tips:

If you installed the MySQL header files and libraries in nonstandard locations (no mysql_config can be found in PATH),

You can specify the --with-mysql-includes and --with-mysql-libs option arguments explicitly, as above.

To compile sysbench without MySQL support, use --without-mysql.
If no database driver is available, database-related scripts will not work, but other benchmarks will work.

#General command line options

The following table lists the supported common options, their descriptions and default values:

Options
describe
default value
--threads
The total number of worker threads to create
1
--events
The total number of requests is limited. 0 (default) means no limit
0
--time
Total execution time limit in seconds. 0 means no limit
10
--warmup-time
Before running the actual benchmark with statistics enabled, execute the event with statistics disabled for a few seconds. This feature is useful when you want to exclude the initial period of the benchmark run from the statistics. In many benchmarks the initial phase is not representative because the CPU/database/page and other caches need some time to warm up
0
--rate
Average transaction rate. This number specifies how many events (transactions) should be executed per second on average across all threads. 0 (default) means unlimited rate, i.e. events are executed as fast as possible
0
--thread-init-timeout
The wait time (in seconds) for the worker thread to initialize
30
--thread-stack-size
The stack size for each thread
32K
--report-interval
Periodically report intermediate statistics at a specified interval (in seconds). Note that this option generates statistics on a time interval basis rather than cumulatively. 0 disables intermediate reporting
0
--debug
Print more debugging information
leave
--validate
Verify test results whenever possible
leave
--help
Print help based on the general syntax or the specified test, then exit.
leave
--verbosity
Verbosity level (0 - critical messages only, 5 - debug)
4
--percentile
sysbench measures the execution time of all processed requests to display statistics such as minimum, average, and maximum execution time. For most benchmarks, it is also useful to know the request execution time values ​​that match a certain percentile (e.g. the 95% percentile means we should discard 5% of the longest requests and pick the largest value from the rest). This option allows specifying the percentile rank of the query execution time to be calculated.
95
--luajit-cmd
Execute LuaJIT control commands. This option is equivalent to luajit -j. See the LuaJIT documentation for more information.

Note that you can specify a byte by appending the corresponding multiplication suffix (K for kilobytes, M for megabytes, G for gigabytes, T for terabytes).
to specify values ​​for all size options (--thread-stack-size as shown in this table).

#sysbench uses [command] commonly used are:

1) prepare for testing and generate data
2) Run the test
3) cleanup cleans up data
4) help
5) version

The above is the detailed introduction to the use of MySQL performance stress benchmark testing tool sysbench. For more information on the use of MySQL sysbench, please pay attention to other related articles on 123WORDPRESS.COM!

You may also be interested in:
  • MySQL 5.7.20 common download, installation and configuration methods and simple operation skills (decompression version free installation)
  • MySQL 8.0.23 installation and configuration method graphic tutorial under win10
  • Detailed tutorial on sysbench stress testing of mysql
  • MySQL stress testing method How to use mysqlslap to test MySQL stress?
  • MySQL stress test script example
  • Mysqlslap MySQL stress testing tool simple tutorial
  • MySQL series 15 MySQL common configuration and performance stress test

<<:  Implementation of Docker deployment of SQL Server 2019 Always On cluster

>>:  Why Use DOCTYPE HTML

Recommend

Solve the problem of inconsistent MySQL storage time

After obtaining the system time using Java and st...

Detailed explanation of mixed inheritance in Vue

Table of contents The effect of mixed inheritance...

Talking about Less and More in Web Design (Picture)

Less is More is a catchphrase for many designers....

Detailed explanation of 7 SSH command usages in Linux that you don’t know

A system administrator may manage multiple server...

How to hide rar files in pictures

You can save this logo locally as a .rar file and...

Comprehensive understanding of line-height and vertical-align

Previous words Line-height, font-size, and vertica...

How to execute PHP scheduled tasks in CentOS7

Preface This article mainly introduces the releva...

Robots.txt detailed introduction

Robots.txt is a plain text file in which website ...

Getting Started: A brief introduction to HTML's basic tags and attributes

HTML is made up of tags and attributes, which are...

How to set the page you are viewing to not allow Baidu to save its snapshot

Today, when I searched for a page on Baidu, becaus...

Detailed explanation of Docker common commands Study03

Table of contents 1. Help Command 2. Mirror comma...

CSS3 realizes the effect of triangle continuous enlargement

1. CSS3 triangle continues to zoom in special eff...

Writing a shell script in Ubuntu to start automatically at boot (recommended)

The purpose of writing scripts is to avoid having...