In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Installation method:
Download address: https://github.com/akopytov/sysbench
Yum install automake libtool-y
Unzip sysbench-0.5.zip & & cd sysbench-0.5 & & sh autogen.sh & &. / configure & & make & & make install
Sysbench supports the following test modes:
1. CPU computing performance
2. Disk IO performance
3. Scheduler performance
4. Memory allocation and transmission speed
5. POSIX thread performance
6. Database performance (OLTP benchmark)
At present, sysbench mainly supports several databases such as mysql,drizzle,pgsql,oracle.
CPU benchmark Test of sysbench
Principle: the performance of CPU is tested by finding the maximum prime number.
Cat / proc/cpuinfo View the configuration of CPU
Sysbench-- test=cpu-- cpu-max-prime=20000 run results as shown below, which takes 39.9044 seconds to execute
Sysbench command usage:
Sysbench-test= help can view all kinds of help information
Sysbench file IO benchmark test
The SSD disk mounted on Ali CVM is tested here, so you need to change to the mount directory of SSD.
Cd / bdata/ & & makedir sysbench_test & & cd sysbench_test/
Step1, open 16 threads to generate 2G test data files [Note that the file size should exceed the memory size, so that the IO overhead can be tested]
Sysbench-test=fileio-file-total-size=4G-num-threads=16 prepare
Step2, perform a read-write test [the following command is to perform a mixed random read-write benchmark]
Sysbench-test=fileio-file-total-size=4G-num-threads=16-file-test-mode=rndrw-init-rng=on--max-time=300-max-requests=0 run
As can be seen from the picture above, read 18.122G and write 12.081G. The number of requests is 6597.99 per second. The throughput is 103Mb/ seconds.
Supplement: several testing options
Seqwr sequential write
Seqrewr sequential rewriting
Seqrd sequential read
Rndrd random read
Rndwr random write
Rndrw mixed random read / write
Step3, delete test files
Sysbench-test=fileio-file-total-size=2G cleanup
OLTP benchmark Test of sysbench
The OLTP benchmark simulates the workload of a simple transaction processing system.
Help command: sysbench-- test=oltp help
OLTP test environment:
Aliyun ECSMySQL5.6 4 Core 8G 500GB SSD
Step1, generate table file
In the course of my experiment, I found that the oltp test of sysbench0.5 was a little different. You must change to the path of sysbench's installation package, or you will be prompted that the lua file is missing.
Cd / root/sysbench-0.5/sysbench/tests/db
Sysbench-test=oltp.lua-oltp-table-size=1000000-oltp_tables_count=10-mysql-db=test--mysql-user=root-mysql-password='123456'-mysql-socket='/tmp/mysql.sock'-db-driver=mysql-rand-init=on prepare
# this operation generates a test.sbtest1 table.
Oltp-table-size=1000000 indicates that each test table is populated with 1 million rows of data.
Rand-init=on indicates that each test table is populated with random data.
-- oltp_tables_count=10 indicates that 10 test tables will be generated
In the real test scenario, it is recommended to have no less than 10 data tables and no less than 5 million rows of data in a single table. Of course, it depends on the hardware configuration of the server. If you are equipped with a high IOPS device such as SSD or PCIE SSD, it is recommended that you have at least 100 million rows of data in a single table.
Step2, 8 thread testing
Sysbench-test=oltp.lua-oltp-table-size=1000000\
-mysql-db=test-mysql-user=root-mysql-password='123456'\
-mysql-socket='/tmp/mysql.sock'-db-driver=mysql-oltp-read-only=off\
-max-time=60-- num-threads=8-- report-interval=10-- rand-type=uniform\
-max-requests=0-- percentile=99 run > > / tmp/sysbench-oltp-2017-04-27.log
The above parameters describe: start 8 concurrent threads, read / write mode, and test for 60 seconds.
Other parameters:
-- num-threads=8 indicates that 8 concurrent connections are initiated
-- oltp-read-only=off means no read-only test, that is, a mixed read-write test.
-- report-interval=10 indicates that a test progress report is output 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 means to set the sampling ratio. Default is 95%, that is, discard 1% of long requests and take the maximum value in the remaining 99%.
The results are as follows:
OLTP test statistics:
Queries performed:
Read: total number of 502936 reads
Write: 143696 total number of writes
Other: 71848 Total number of other operations (operations other than SELECT, INSERT, UPDATE, DELETE, e.g. COMMIT, etc.)
Total: 718480 total
Transactions: 35924 (598.65 per sec.) Total transactions (transactions per second)
Read/write requests: 646632 (10775.68 per sec.) Total number of reads and writes (reads and writes per second)
Other operations: 71848 (1197.30 per sec.) Total number of other operations (other operations per second)
Ignored errors: 0 (0.00 per sec.)
Reconnects: 0 (0.00 per sec.)
General statistics:
Total time: 60.0084s total time consuming
Total number of events: 35924 how many transactions have taken place
Total time taken by event execution: 479.9595s the sum of all transactions (regardless of parallelism)
Response time:
Min: minimum time consuming for 6.19ms
Avg: average time consumed by 13.36ms
Max: 187.06ms maximum time-consuming
Approx. 99 percentile: average time spent when 30.73ms exceeds 99%
Threads fairness:
Events (avg/stddev): 4490.5000Mab 8.03
Execution time (avg/stddev): 59.99490.00
Step3, clean up the 10 test tables generated above
Sysbench-test=oltp.lua-oltp-table-size=1000000-oltp-tables-count=10\
-mysql-db=test-mysql-user=root-mysql-password='123456'\
-mysql-socket='/tmp/mysql.sock'-db-driver=mysql-num-threads=8 cleanup
After tuning the database, you can use sysbench to test OLTP to see if TPS has improved.
Note: sysbench testing is a benchmark and does not represent performance metrics in an actual enterprise environment.
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
[oracle@rac01 ~] $crsctlUsage: crsctl check crs-checks the viability of the CRS stack
© 2024 shulou.com SLNews company. All rights reserved.