In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces "the installation and testing steps of mysql sysben0.5". In the daily operation, I believe many people have doubts about the installation and testing steps of mysql sysben0.5. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts about "installation and testing steps of mysql sysben0.5". Next, please follow the editor to study!
Install sysbench
OS readhat 6.4
Mysql version 5.7
Mysql installation directory
Download the installation package https://github.com/akopytov/sysbench
Shell > wget https://github.com/akopytov/sysbench/archive/1.0.zip-O "sysbench-1.0.zip"
two。 Install dependency packages
# yum-y install make automake libtool pkgconfig libaio-devel vim-common
3. Upload it to the linux system (/ usr/local/), decompress it, and enter / usr/local/ to execute:
P unzip sysbench-0.5.zip-d / usr/local
4. Create the sysbench installation directory folder:
5. Enter / usr/local/sysbench-master/ to execute:. / autogen.sh
# cd / usr/local/sysbench-0.5
#. / autogen.sh
6.
#. / configure-prefix=/usr/local/sysbench-0.5-with-mysql-includes=/usr/local/mysql/include-with-mysql-libs=/usr/local/mysql/lib/
7.
# make
8.
# make install
9. View version
[root@msyqlzhu sysbench-0.5] # / usr/local/sysbench-0.5/bin/sysbench version
Sysbench 0.5
If an error occurs: (sysbench: error while loading shared libraries: libmysqlclient.so.20: cannot open shared object file: No such file or directory)
Then add: export LD_LIBRARY_PATH=/usr/local/mysql/lib/ to (vim / etc/profile)
Common parameters:
#-test=tests/db/oltp.lua means calling the tests/db/oltp.lua script to test the oltp pattern
#-oltp_tables_count=10 indicates that 10 test tables will be generated
#-oltp-table-size=100000 indicates that each test table is filled with 100000 data
#-rand-init=on indicates that each test table is populated with random data
#-num-threads=8 means initiating 8 concurrent connections
#-oltp-read- means no read-only test, that is, a mixed read-write test
#-report-interval=10 means to output a test progress report every 10 seconds
#-rand-type=uniform indicates that the random type is fixed, and there are several other optional random modes: uniform (fixed), gaussian (Gaussian), special (specific), pareto (Pareto)
#-max-time=120 indicates that the maximum execution time is 120 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: set the sampling ratio. Default is 95%, that is, discard 1% of long requests and take the maximum value in the remaining 99%.
Test file IO
The CPU test for testing cpu uses 64-bit integers to test the time it takes to calculate primes to a certain maximum.
# / usr/local/sysbench-0.5/bin/sysbench-test=cpu-cpu-max-prime=20000 run
General statistics:
Total time: 26.8631s
Total number of events: 10000
Total time taken by event execution: 26.8434s
Response time:
Min: 2.24ms
Avg: 2.68ms
Max: 7.49ms
Approx. 95 percentile: 3.20ms
Threads fairness:
Events (avg/stddev): 10000.0000Universe 0.00
Execution time (avg/stddev): 26.84340.00
1. Test thread
[root@msyqlzhu t] # / usr/local/sysbench-0.5/bin/sysbench-test=threads-num-threads=64 run
Sysbench 0.5: multi-threaded system evaluation benchmark
Running the test with following options:
Number of threads: 64
Random number generator seed is 0 and will be ignored
Initializing worker threads...
Threads started!
General statistics:
Total time: 5.2132s
Total number of events: 10000
Total time taken by event execution: 332.6492s
Response time:
Min: 0.23ms
Avg: 33.26ms
Max: 282.98ms
Approx. 95 percentile: 87.66ms
Threads fairness:
Events (avg/stddev): 156.2500Universe 5.53
Execution time (avg/stddev): 5.1976Universe 0.01
two。 Mutex test mutex (mutex)
/ usr/local/sysbench-0.5/bin/sysbench-test=mutex-num-threads=16-mutex-num=2048-mutex-locks=1000000-mutex-loops=5000 run
Sysbench 0.5: multi-threaded system evaluation benchmark
Running the test with following options:
Number of threads: 16
Random number generator seed is 0 and will be ignored
Initializing worker threads...
Threads started!
General statistics:
Total time: 2.5536s
Total number of events: 16
Total time taken by event execution: 39.6446s
Response time:
Min: 2348.59ms
Avg: 2477.79ms
Max: 2553.24ms
Approx. 95 percentile: 2549.79ms
Threads fairness:
Events (avg/stddev): 1.0000amp 0.00
Execution time (avg/stddev): 2.4778 Universe 0.07
3. Memory test
[root@msyqlzhu] # / usr/local/sysbench-0.5/bin/sysbench-test=memory-memory-block-size=8K-memory-total-size=1G-num-threads=16 run
4. File IO benchmark
Total 1G
[root@msyqlzhu] # / usr/local/sysbench-0.5/bin/sysbench-- test=fileio-- file-total-size=1G prepare
1073741824 bytes written in 8.15 seconds (125.60 MB/sec).
Test file IO 4 files total 4G
[root@msyqlzhu] # / usr/local/sysbench-0.5/bin/sysbench-test=fileio-file-num=4-file-total-size=4G prepare
4261412864 bytes written in 6.52 seconds (623.68 MB/sec).
Test file IO 4 files altogether 4G. Block size is 16K
[root@msyqlzhu] # / usr/local/sysbench-0.5/bin/sysbench-test=fileio-file-num=4-file-block-size=16384-file-total-size=4G prepare
This command creates test files in the current working directory, and subsequent run phases will test these files by reading and writing them. The second step is the run phase, with different test options for different IO types:
Seqwr sequential write
Seqrewr sequential rewriting
Seqrd sequential read
Rndrd random read
Rndwr random write
Rndrw mixed random read / write
The following command runs the file Iram O mixed random read / write benchmark:
Mixed random read / write
/ usr/local/sysbench-0.5/bin/sysbench-test=fileio-file-total-size=4G-file-test-mode=rndrw-init-rng=on-max-time=300-max-requests=0 run
Clear the tested file
/ usr/local/sysbench-0.5/bin/sysbench-test=fileio-fil-total-size=30G cleanup
Test oltp
1. Find the select.lua script path
[root@msyqlzhu t] # find /-name oltp.lua
/ usr/local/sysbench-0.5/sysbench/tests/db/oltp.lua
two。 The sbtest library is used by default when creating tests
> create database sbtest
3.prepare generates data and tables
Parameters used
-- the number of records of the table generated by oltp-table-size
-- the number of tables generated by oltp-tables-count
# / usr/local/sysbench-0.5/bin/sysbench-test=/usr/local/sysbench-0.5/sysbench/tests/db/oltp.lua-oltp-table-size=100000-mysql-user=root-oltp-tables-count=10-mysql-password=ORACLE-mysql-socket=/mysqldata/mysql/data/mysql.sock prepare
4.run operation
You can also use parallel_prepare.lua scripts to prepare test data in parallel
Parameters used at run time
-- percentage of oltp-dist-pct hotspot data
-- oltp-dist-res hotspot data access frequency
-- number of num-threads threads
-- max-time=3000 execution time
-- the interval between report-interval printing the report
# / usr/local/sysbench-0.5/bin/sysbench-test=/usr/local/sysbench-0.5/sysbench/tests/db/oltp.lua-- num-threads=20-- oltp-dist-pct=1-- oltp-dist-res=75-- oltp-table-size=100000-- num-threads=100-- mysql-db=sbtest-- mysql-user=root-- oltp-tables-count=10-- max-time=3000-- max-requests=0-- report-interval=3-- mysql-password=ORACLE-- mysql-socket=/mysqldata/mysql/data/mysql.sock run
The generated report, tps: about 495, response time response time about 380ms, qps about 6000s
[141s] threads: 100, tps: 481.38, reads: 6728.28, writes: 2001.18, response time: 369.82ms (95%), errors: 0.33, reconnects: 0.00
[144s] threads: 100, tps: 495.94, reads: 6958.09, writes: 1970.41, response time: 339.89ms (95%), errors: 0.00, reconnects: 0.00
[147s] threads: 100, tps: 513.72, reads: 7193.10, writes: 2076.22, response time: 326.33ms (95%), errors: 0.33, reconnects: 0.00
[150s] threads: 100, tps: 494.33, reads: 6921.66, writes: 1971.33, response time: 333.44ms (95%), errors: 0.33, reconnects: 0.00
[153s] threads: 100, tps: 441.32, reads: 6032.87, writes: 1685.30, response time: 396.06ms (95%), errors: 0.00, reconnects: 0.00
[156s] threads: 100, tps: 502.62, reads: 7007.69, writes: 2000.82, response time: 398.92ms (95%), errors: 0.00, reconnects: 0.00
[159s] threads: 100, tps: 428.68, reads: 6192.48, writes: 1805.71, response time: 365.53ms (95%), errors: 0.00, reconnects: 0.00
[162s] threads: 100, tps: 438.70, reads: 6140.14, writes: 1777.47, response time: 586.58ms (95%), errors: 0.33, reconnects: 0.00
[165s] threads: 100, tps: 495.63, reads: 6928.11, writes: 1951.51, response time: 380.04ms (95%), errors: 0.00, reconnects: 0.00
5.clearnup
# / usr/local/sysbench-0.5/bin/sysbench-test=/usr/local/sysbench-0.5/sysbench/tests/db/oltp.lua-oltp-table-size=100000-mysql-db=sbtest-mysql-user=root-oltp-tables-count=10-mysql-password=ORACLE-mysql-socket=/mysqldata/mysql/data/mysql.sock cleanup
Test select
1.prepare generates data
# / usr/local/sysbench-0.5/bin/sysbench-test=/usr/local/sysbench-0.5/sysbench/tests/db/select.lua-oltp-table-size=10000000-mysql-user=root-oltp-tables-count=10-mysql-password=ORACLE-mysql-socket=/mysqldata/mysql/data/mysql.sock prepare
2.run operation
Parameters used at run time
-- percentage of oltp-dist-pct hotspot data
-- oltp-dist-res hotspot data access frequency
-- number of num-threads threads
-- max-time=3000 execution time
-- the interval between report-interval printing the report
The reads of the printed report indicates that qps,response time indicates the response time.
# / usr/local/sysbench-0.5/bin/sysbench-test=/usr/local/sysbench-0.5/sysbench/tests/db/select.lua-- num-threads=20-- oltp-dist-pct=1-- oltp-dist-res=75-- oltp-table-size=100000-- num-threads=10-- mysql-db=sbtest-- mysql-user=root-- oltp-tables-count=10-- max-time=3000-- max-requests=0-- report-interval=3-- mysql-password=ORACLE-- mysql-socket=/mysqldata/mysql/data/mysql.sock run
[84s] threads: 100, tps: 0.00, reads: 22529.11, writes: 0.00, response time: 0.14ms (95%), errors: 0.00, reconnects: 0.00
[87s] threads: 100, tps: 0.00, reads: 22455.45, writes: 0.00, response time: 0.14ms (95%), errors: 0.00, reconnects: 0.00
[90s] threads: 100, tps: 0.00, reads: 22569.36, writes: 0.00, response time: 0.13ms (95%), errors: 0.00, reconnects: 0.00
[93s] threads: 100, tps: 0.00, reads: 21957.72, writes: 0.00, response time: 0.15ms (95%), errors: 0.00, reconnects: 0.00
[96s] threads: 100, tps: 0.00, reads: 21588.06, writes: 0.00, response time: 0.14ms (95%), errors: 0.00, reconnects: 0.00
Cleanup
# / usr/local/sysbench-0.5/bin/sysbench-test=/usr/local/sysbench-0.5/sysbench/tests/db/select.lua-- oltp-dist-pct=1-- oltp-dist-res=75-- oltp-table-size=100000-- num-threads=10-- mysql-db=sbtest-- mysql-user=root-- oltp-tables-count=10-- mysql-password=ORACLE-- mysql-socket=/mysqldata/mysql/data/mysql.sock cleanup
Common parameters:
Parameters commonly used in Run
-oltp-tables-count
-oltp-read-only only executes SELECT test on | off. Default is off.
-oltp-dist-type random number distribution state. Uniform (uniform distribution), gauss (Gaussian distribution), special (special distribution)
Percentage value of-oltp-dist-pct special distribution
-percentage of oltp-dist-res special distribution
-oltp-point-selects the number of selec queries specified in a single transaction
-the range size of the oltp-range-size range query, which should be smaller than oltp-table-size
-oltp-simple-ranges the number of simple range queries specified in a single transaction
-oltp-sum-ranges the number of SUM range queries specified in a single transaction
-oltp-order-ranges the number of ORDER range queries specified in a single transaction
-oltp-distinct-ranges the number of DISTINCT range queries specified in a single transaction
-oltp-index-updates the specified number of updates using indexes in a single transaction
-oltp-non-index-updates the number of non-index updates specified in a single transaction
At this point, the study on the "installation and testing steps of mysql sysben0.5" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
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.