In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Background
Recently, I was fascinated by performance testing, so I learned a pressure artifact called sysbench.
Sysbench is an open source project on github
Link address: https://github.com/akopytov/sysbench
General installation method
1.clone and download Select copy URL
2.cd / tmp-- > Centos terminal input git clone https://github.com/akopytov/sysbench.git
3. Follow the installation instructions of the source code in README.MD step by step.
Yum-y install make automake libtool pkgconfig libaio-devel
Yum-y install mariadb-devel
. / autogen.sh
. / configure
Make-j
Make install
Sysbench Test I Dot O
Keywords: randomly generate data, test different disks, execute commands in different disk directories
Preparation phase: sysbench-test=fileio-num-threads=4-file-total-size=10G-file-test-mode=rndrw prepare
Stress testing phase: sysbench-test=fileio-num-threads=4-file-total-size=10G-file-test-mode=rndrw run
Clean data phase: sysbench-- test=fileio-- num-threads=4-- file-total-size=10G-- file-test-mode=rndrw cleanup
Basic name resolution = = what is the stress test to focus on?
TPS:Transactions Per Second, the number of transactions transferred per second. This refers to the number of transactions per second processed by the server and is a performance indicator unique to the storage engine that supports transactions.
QPS:Queries Per Second, query processing per second, suitable for most storage engines.
TpmC:Transactions Per Minute, the volume of transactions processed per minute, which is equivalent to TPS, is the test indicator (tpcc-mysql) of TPC-C.
Iops: the number of iUnip O operations performed by the disk per second
Iowait: what percentage of the time in a sampling period is spent: CPU is idle and there are still outstanding Icano requests
Svctm: the average time it takes the device to process the request (ms). It refers to the time it takes for read and write requests to break away from linux kernel scheduling and enter the read and write phase of the device.
% util: it can be simply understood as: the busy ratio of the equipment per unit time. For example, if you have 10 seconds and 6 seconds to read and write, then util = 60%.
Number of Icano bytes per second (Ithumb O throughput)
Transaction response time
Device-level IOPS, read and write delay data provided by iPUBO device
Indicators of general concern
Response time avg: average response time
TPS and OPS
Related indicators of cpu, io and mem at the system level
How to determine which test mode performs better
If the two tps/tpmC are the same, then whoever has lower transaction response time, iowait, svctm,% util, read and write latency is better.
An example of mysql pressure test
Sysbench/ tmp/sysbench/src/lua/oltp_read_write.lua\
-- mysql-host=127.0.0.1-- mysql-port=3306\
-- mysql-user=sysbench-- mysql-password=sysbench\
-mysql-db=sbtest-- tables=10-- table-size=100000-- threads=1\
-report-interval=10-rand-type=uniform-max-time=300\
-max-requests=0-percentile=99 prepare/run/cleanup
The result is assigned to the file:
Run > >. / log/sysbench_oltpX_20180313.log
Parameter explanation:
. / src/lua/oltp_read_write.lua means to call this script to test the oltp pattern
-- mysql-db=sbtest represents the specified test library
-- tables=10 means to generate 10 test tables
-- table-size=100000 indicates that each test table is filled with 100000 data.
Parameters for run mode:
-- threads=1 indicates that 1 concurrent connection is initiated
-- report-interval=10 indicates that a test progress report is output every 10 seconds
-- rand-type=uniform indicates that the random type is a fixed pattern
-- max-time=300 indicates that the maximum execution time is 300 seconds
-- max-requests=0 indicates that the total number of requests is 0, because the total execution time has been defined above, so the total number of requests can be set to 0, or only the total number of requests can be set without setting the maximum execution time.
-- percentile=99 means to set the sampling ratio. The default is 95%. That is, discard 1% of long requests and take the maximum value in the remaining 99%.
Pressure testing trilogy
Prepare: preparation phase, preparation of data
Run: stress test execution
Cleanup: clean up the data immediately after the pressure test
What to do after each stress test
After each round of testing, restart the mysqld instance and delete the system cache, release the swap (if swap is used), or even restart the entire OS using the following methods
Shell > sync-- flushing dirty data to disk
Shell > echo 3 > / proc/sys/vm/drop_caches-clear OS Cache
Shell > swapoff-a & & swapon-a
Draw a picture
Install the windows client for drawing
Software: gp507-win64-mingw
Download url: https://jaist.dl.sourceforge.net/project/gnuplot/gnuplot/5.0.7/gp507-win64-mingw.exe
For example:
Plot'C:\ Users\ limin\ Downloads\ 20180314.log' using 7 with linespoint title 'vm1-TPS'
'C:\ Users\ limin\ Downloads\ 20180314-10.log' using 7 with linespoint title 'vm2-TPS'
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.