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

js to create a carousel effect

I think the carousel is a relatively important po...

The solution record of Vue failing to obtain the element for the first time

Preface The solution to the problem of not being ...

The table tbody in HTML can slide up and down and left and right

When the table header is fixed, it needs to be di...

How to directly reference vue and element-ui in html

The code looks like this: <!DOCTYPE html> &...

HTML special character conversion table

character Decimal Character Number Entity Name --...

Docker implements re-tagging and deleting the image of the original tag

The docker image id is unique and can physically ...

JS implements a detailed plan for the smooth version of the progress bar

The progress bar is not smooth I believe that mos...

Detailed explanation of the use of MySQL select cache mechanism

MySQL Query Cache is on by default. To some exten...

React Fiber structure creation steps

Table of contents React Fiber Creation 1. Before ...

Use Vue3+Vant component to implement App search history function (sample code)

I am currently developing a new app project. This...

A detailed explanation of how React Fiber works

Table of contents What is React Fiber? Why React ...

Remote Desktop Connection between Windows and Linux

When it comes to remote desktop connection to Lin...

Vue3.0 routing automatic import method example

1. Prerequisites We use the require.context metho...