Sysbench benchmark, sysbench Benchmark

Source: Internet
Author: User

Sysbench benchmark, sysbench Benchmark

1. Introduction

Sysbench is an open-source multi-threaded performance testing tool that can perform performance tests on CPU, memory, thread, IO, and database. The database currently supports MySQL, Oracle, and PostgreSQL. This article only briefly demonstrates the usage of several tests. We will use sysbench to perform a series of tests on MySQL in the future. Specific parameter settings must be adjusted according to different test requirements.


2. Installation

# Install the yum package and configure the environment variable yum-y install bzr libtool wget http://imysql.com/wp-content/uploads/2014/09/sysbench-0.4.12-1.1.tgzcat 'export LD_LIBRARY_PATH =/db/mysql/lib'>/etc/profilesource/etc/profile # install sysbenchmkdir -p/Data/apps/sysbenchmkdir-p/Data/apps/sysbench/logtar-zxvf sysbench-0.4.12-1.1.tgzcd sysbench-0.4.12-1.1. /autogen. sh. /configure -- prefix =/Data/apps/sysbench -- with-mysql-related des =/Data/apps/mysql/include -- with-mysql-libs =/Data/apps/mysql/ libmake & make installcp/Data/apps/sysbench/bin/sysbench/usr/local/bin/#/Data/package/sysbench-0.4.12-1.1 for the installation package directory cp-a/Data/package/ sysbench-0.4.12-1.1/sysbench/tests/Data/apps/sysbench/


3. Test

3.1 Mysql database Test

mysql > create database sbtest;
sysbench --mysql-host=127.0.0.1 --mysql-port=3306 --mysql-user=root --mysql-password='' --test=/Data/apps/sysbench/tests/db/oltp.lua --oltp_tables_count=10 --oltp-table-size=100000 --rand-init=on prepare

# -- Test = tests/db/oltp. lua indicates that the tests/db/oltp. lua script is called to test the oltp mode.
# -- Oltp_tables_count = 10 indicates that 10 test tables will be generated.
# -- Oltp-table-size = 100000 indicates the number of data rows in each test table
# -- Rand-init = on indicates that each test table is filled with random data.


sysbench --mysql-host=127.0.0.1 --mysql-port=3306 --mysql-user=root --mysql-password='' --test=/Data/apps/sysbench/tests/db/oltp.lua --oltp_tables_count=10 --oltp-table-size=10000000 --num-threads=8 --oltp-read-only=off --report-interval=10 --rand-type=uniform --max-time=120 --max-requests=0 --percentile=99 run >> /Data/apps/sysbench/log/sysbench_oltp.log


# -- Num-threads = 8 indicates that eight concurrent connections are initiated.
# -- Oltp-read-only = off indicates that the read-only test is not performed, that is, the read/write mixed mode test is used.
# -- Report-interval = 10 indicates that a Test Progress report is output every 10 seconds.
# -- Rand-type = uniform indicates that the random type is fixed. The other several optional random modes are uniform (fixed), gaussian (gaussian), special (specific), and pareto ()
# -- Max-time = 120 indicates the maximum execution duration is 120 seconds.
# -- Max-requests = 0 indicates that the total number of requests is 0. Because the total execution duration has been defined above, the total number of requests can be set to 0. You can also set only the total number of requests, do not set the maximum execution duration
# -- Percentile = 99 indicates that the sampling ratio is set. The default value is 95%, that is, to discard a 1% long request and obtain the maximum value in the remaining 99%.


= ================== Sysbench 0.5: multi-threaded system evaluation benchmarkRunning the test with following options: Number of threads: 8 Report intermediate results every 10 second (s) Random number generator seed is 0 and will be ignoredThreads started! [10 s] threads: 8, tps: 26.60, reads/s: 410.22, writes/s: 115.11, response time: 1050.29 ms (99%) [20 s] threads: 8, tps: 32.40, reads/s: 462.00, writes/s: 131.60, response time: 699.68 ms (99%) [30 s] threads: 8, tps: 33.00, reads/s: 467.60, writes/s: 133.20, response time: 496.50 ms (99%) [40 s] threads: 8, tps: 30.80, reads/s: 441.00, writes/s: 125.30, response time: 617.02 ms (99%) [50 s] threads: 8, tps: 35.80, reads/s: 504.00, writes/s: 143.80, response time: 526.03 ms (99%) [60 s] threads: 8, tps: 33.20, reads/s: 468.50, writes/s: 133.30, response time: 774.87 ms (99% )......... [3540 s] threads: 8, tps: 41.90, reads/s: 602.00, writes/s: 170.90, response time: 483.88 ms (99%) [3550 s] threads: 8, tps: 43.40, reads/s: 616.00, writes/s: 175.40, response time: 383.69 ms (99%) [3560 s] threads: 8, tps: 38.00, reads/s: 543.20, writes/s: 154.40, response time: 475.41 ms (99%) [3570 s] threads: 8, tps: 39.60, reads/s: 560.00, writes/s: 159.60, response time: 425.82 ms (99%) [3580 s] threads: 8, tps: 42.10, reads/s: 600.60, writes/s: 170.80, response time: 384.04 ms (99%) [3590 s] threads: 8, tps: 38.10, reads/s: 547.40, writes/s: 155.40, response time: 542.17 ms (99%) [3600 s] threads: 8, tps: 40.40, reads/s: 574.00, writes/s: 163.40, response time: 459.05 ms (99%) OLTP test statistics: queries saved med: read: 2068584 -- total read write: 588759 -- total write count other: 293247 -- total number of other operations (operations other than SELECT, INSERT, UPDATE, and DELETE, such as COMMIT) total: 2950590 -- total number of transactions: 145491 (40.41 per sec .) -- total transactions (transactions per second) deadlocks: 2265 (0.63 per sec .) -- total number of deadlocks read/write requests: 2657343 (738.12 per sec .) -- total read/write count (Reads/writes per second) other operations: 293247 (81.45 per sec .) -- total number of other operations (other operations per second) General statistics: total time: 3600.1452 s -- total time consumed total number of events: 145491 -- total number of transactions occurring total time taken by event execution: 28800.5977 s -- total transaction time consumption (parallel factors not considered) response time: min: 49.84 ms -- minimum time consumption avg: 197.95 ms -- average time consumption max: 1355.40 ms -- maximum time consumption approx. 99 percentile: 433.54 ms -- over 99% average time consumed Threads fairness: events (avg/stddev): 18186.3750/63.14 execution time (avg/stddev): 3600.0747/0.04

3.2 CPU Test

The sysbench CPU test uses a 64-bit integer to test the time required to calculate the prime number until a maximum value is reached.

Shell> sysbench -- test = cpu -- cpu-max-prime = 2000 runsysbench 0.5: multi-threaded system evaluation benchmarkRunning the test with following options: Number of threads: 1 Random number generator seed is 0 and will be ignoredPrimer numbers limit: 2000 Threads started! Test execution summary: total time: 2.2452 s total number of events: 10000 total time taken by event execution: 2.2347 s per-request statistics: min: 0.20 ms avg: 0.22 ms max: 3.35 ms approx. 95 percentile: 0.27 msThreads fairness: events (avg/stddev): 10000.0000/0.00 execution time (avg/stddev): 2.2347/0.00 supplement: view CPU Information Method view number of physical CPUs grep "physical id"/proc/cpuinfo | sort-u | wc-l view Number of cores grep "core id"/proc/cpuinfo | sort- u | wc-l check the number of threads grep "processor"/proc/cpuinfo | sort-u | wc-l in sysbench testing, -- num-threads: set the value to "Number of threads ".



3.3 thread Test

Test the performance of the thread scheduler. It is very useful for testing thread schedulers under high loads.

shell> sysbench --test=threads --num-threads=64 --thread-yields=100 --thread-locks=2 runsysbench 0.5:  multi-threaded system evaluation benchmarkRunning the test with following options:Number of threads: 64Random number generator seed is 0 and will be ignoredThreads started!Test execution summary:    total time:                          1.9581s    total number of events:              10000    total time taken by event execution: 124.8938s    per-request statistics:         min:                                  0.05ms         avg:                                 12.49ms         max:                                151.15ms         approx.  95 percentile:              50.83msThreads fairness:    events (avg/stddev):           156.2500/14.48    execution time (avg/stddev):   1.9515/0.00

3.4 file I/O performance test
  • Generate the required test file with a total file size of 5 GB and 16 concurrent threads. After execution, a pile of small files will be generated in the current directory.
shell> sysbench --test=fileio --num-threads=16 --file-total-size=5G prepare
  • Run the test and specify the random read/write mode.

Read/write mode:

  1. Seqwr sequential write
  2. Seqrewr sequential Rewriting
  3. Seqrd sequential read
  4. Random rndrd read
  5. Rndwr random write
  6. Rndrw mixed random read/write
Shell> sysbench -- test = fileio -- num-threads = 16 -- init-rng = on -- file-total-size = 5G -- file-test-mode = rndrw runsysbench 0.5: multi-threaded system evaluation benchmarkRunning the test with following options: Number of threads: 16 Random number generator seed is 0 and will be ignoredThreads started! Operations completed MED: 5999 reads, 4001 writes, 12800 Other = 22800 TotalRead 93.734 Mb Written 62.516 Mb Total transferred 156.25 Mb (9.2561 Mb/sec) # throughput 592.39 Requests/sec executedTest execution summary: total time: 16.8808 s total number of events: 10000 total time taken by event execution: 176.1816 s per-request statistics: min: 0.01 ms avg: 17.62 ms max: 416.73 ms approx. 95 percentile: 104.82 msThreads fairness: events (avg/stddev): 625.0000/62.39 execution time (avg/stddev): 11.0114/0.67
  • Clear test files
shell> sysbench --test=fileio --num-threads=16 --file-total-size=5G cleanup
3.5 Mutex Test

Test the mutex lock performance by simulating concurrent running of all threads at the same time and temporarily requesting mutex locks.

shell> sysbench --test=mutex --num-threads=16 --mutex-num=1024 --mutex-locks=10000 --mutex-loops=5000 runsysbench 0.5:  multi-threaded system evaluation benchmarkRunning the test with following options:Number of threads: 16Random number generator seed is 0 and will be ignoredThreads started!Test execution summary:    total time:                          0.0135s    total number of events:              16    total time taken by event execution: 0.0411s    per-request statistics:         min:                                  0.70ms         avg:                                  2.57ms         max:                                  9.19ms         approx.  95 percentile:               9.16msThreads fairness:    events (avg/stddev):           1.0000/0.00    execution time (avg/stddev):   0.0026/0.00
3.6 Memory Test

The memory test tests the continuous read/write performance of the memory.

Shell> sysbench -- test = memory -- num-threads = 16 -- memory-block-size = 8192 -- memory-total-size = 1G runsysbench 0.5: multi-threaded system evaluation benchmarkRunning the test with following options: Number of threads: 16 Random number generator seed is 0 and will be ignoredThreads started! Operations completed MED: 131072 (381158.38 ops/sec) 1024.00 MB transferred (2977.80 MB/sec) # throughput Test execution summary: total time: 0.3439 s total number of events: 131072 total time taken by event execution: 3.9915 s per-request statistics: min: 0.00 ms avg: 0.03 ms max: 51.02 ms approx. 95 percentile: 0.00 ms # Threads fairness: events (avg/stddev): 95%/8192.0000 execution time (avg/stddev): 1166.77/0.2495


References:

Sysbench installation, use, and result interpretation

Sysbench 0.5 Benchmark Test



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.