The latest open-source multi-threaded performance test tool-sysbench

Source: Internet
Author: User

The latest open-source multi-threaded performance test tool-sysbench
GuideSysbench is an open-source multi-threaded performance testing tool that can perform performance tests on CPU, memory, thread, IO, and database. Currently supported Databases
MySQL/Oracle/PostgreSQL. This article mainly demonstrates the usage of Mysql testing. In the future, we will use sysbench to perform a series of CPU/memory/IO operations.
Test the column. Specific parameter settings must be adjusted according to different test requirements.

Sysbench Introduction

Sysbench is a modular, cross-platform, multi-thread benchmark testing tool used to evaluate the load of systems or databases in different parameter environments.
This document describes how to use sysbench to test the performance load of mysql Databases in linux.

Sysbench mainly supports the following test modes:

  1. CPU Performance
  2. Disk IO Performance
  3. Scheduler Performance
  4. Memory Allocation and transmission speed
  5. POSIX thread Performance
  6. Database performance (OLTP benchmark)

Currently, sysbench mainly supports Mysql, Drizzle, PgSQL, Oracle, and other databases.

1. Download The sysbench source code package and mysql database

1. Currently, the sysbench code is hosted on launchpad. The project address is https://github.com/akopytov/sysbench. download the following formula:

2. MySQL Official Website: http://dev.mysql.com/downloads/mysql/. download the following formula:

Ii. Compilation and Installation

1. Mysql database installation:

For more information about mysql database installation, see another article on this site: Mysql Binary Package installation and configuration practice records, or search Mysql directly in the search box on the right of this site to find many articles about Mysql installation, this article will not be explained.

2. sysbench compilation is very simple. For details, refer to the README document. The simple steps are as follows:

Tar-zxvf sysbench-0.4.8.tar.gzcd sysbench-0.4.8. /configure & make installstrip/usr/local/bin/sysbench, if MySQL is not installed in the standard directory, you must specify the MySQL path. For example, if MySQL is installed in/usr/local/mysql, compile it as follows :. /configure -- with-mysql-related des =/usr/local/mysql/include -- with-mysql-libs =/usr/local/mysql/lib & make install of course, to compile with the above parameters, make sure that there is a corresponding so file under your MySQL lib directory. If not, you can download devel or share package for installation. In addition, if you want to enable sysbench to support pgsql/oracle, you need to add the parameter -- with-pgsql or -- with-oracle at compilation, which is disabled by default, only MySQL is supported by default.
3. Prepare for OLTP Test

Initialize the test database environment (a total of 10 test tables, with 100000 records in each table, filling in randomly generated data ):

cd /tmp/sysbench-0.4.12-1.1/sysbenchmysqladmin create sbtest./sysbench --mysql-host=127.0.0.1 --mysql-port=3317 --mysql-user=tpcc --mysql-password=tpcc \--test=tests/db/oltp.lua --oltp_tables_count=10 --oltp-table-size=100000 --rand-init=on prepare

Explanations of these parameters:

-- Test = tests/db/oltp. lua indicates that tests/db/oltp is called. lua script for oltp mode test -- oltp_tables_count = 10 indicates that 10 test tables will be generated -- oltp-table-size = 100000 indicates that each test table has 100000 filled data. -- rand-init = on indicates each test table they are all filled with random data.

If it is on the local machine, you can also use-mysql-socket to specify the socket file to connect. The duration of loading test data depends on the amount of data. If the process is long, you need to wait patiently.

We recommend that the data table be no less10, the data volume of a single table is not lessLine 3, of course, depends on the server hardware configuration. If you are equipped with a high IOPS device such as SSD or pcie ssd, we recommend that the data volume in a single table be at least0.1 billion rows.

4. Perform OLTP Testing

On the basis of the above initialization data parameters, add some parameters to start the test:

./sysbench --mysql-host=127.0.0.1 --mysql-port=3306 \--mysql-user=tpcc --mysql-password=tpcc \--test=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=3600 \ --mysql-table-engine=myisam --max-requests=0 \ --percentile=99 run >> ./log/sysbench_oltpX_8_20140921.log

Explanations of these parameters:

-- Num-threads = 8 indicates that eight concurrent connections are initiated -- oltp-read-only = off indicates that read-only tests are not performed, that is to say, the mixed read/write mode test -- report-interval = 10 indicates that the Test Progress report is output every 10 seconds -- rand-type = uniform indicates that the random type is set to the fixed mode, other optional random modes: uniform (fixed), gaussian (gaussian), special (specific) -- max-time = 120 indicates the maximum execution duration of 120 seconds -- max-requests = 0 indicates that the total number of requests is 0, because the total execution duration has been defined above, therefore, the total number of requests can be set to 0. You can also set only the total number of requests, without setting the maximum execution duration -- percentile = 99 indicates setting the sampling ratio. The default value is 95%, that is, the 1% long request is discarded. In the remaining 99%, the maximum value -- mysql-table-engine = myisam indicates that the tested table storage engine type is myisam.

That is, the concurrent OLTP test is simulated for 10 tables. Each table has 10 million rows of records and the stress test duration is 1 hour.

It is recommended that the duration of continuous stress testing be no less30 minutes. Otherwise, the test data may be meaningless.

It should be noted that the parameter on the official website is incorrect, that is, -- mysql-table-engine, which is written on the official website -- mysql-table-type, this should be caused by no timely updates.

In addition, the -- mysql-table-engine parameter can be specified as a table storage engine type supported by MySQL, such as innodb.

5. Interpretation of test results

The test results are described as follows:

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! -- The test results are reported every 10 seconds. tps, read per second, write per second, response time of more than 99% [10 s] threads: 8, tps: 1111.51, reads/s: 15568.42, writes/s: 4446.13, response time: 9.95 ms (99%) [20 s] threads: 8, tps: 1121.90, reads/s: 15709.62, writes/s: 4487.80, response time: 9.78 ms (99%) [30 s] threads: 8, tps: 1120.00, reads/s: 15679.10, writes/s: 4480.20, response time: 9.84 ms (99%) [40 s] threads: 8, tps: 1114.20, reads/s: 15599.39, writes/s: 4456.30, response time: 9.90 ms (99%) [50 s] threads: 8, tps: 1114.00, reads/s: 15593.60, writes/s: 4456.70, response time: 9.84 ms (99%) [60 s] threads: 8, tps: 1119.30, reads/s: 15671.60, writes/s: 4476.50, response time: 9.99 ms (99%) OLTP test statistics: queries saved med: read: 938224 -- total read write: 268064 -- total write count other: 134032 -- total number of other operations (operations other than SELECT, INSERT, UPDATE, and DELETE, such as COMMIT) total: 1340320 -- total number of transactions: 67016 (1116.83 per sec .) -- total transactions (transactions per second) deadlocks: 0 (0.00 per sec .) -- total number of deadlocks read/write requests: 1206288 (20103.01 per sec .) -- total read/write count (Reads/writes per second) other operations: 134032 (2233.67 per sec .) -- total number of other operations (other operations per second) General statistics: -- some statistical results total time: 60.0053 s -- total time consumed total number of events: 67016 -- total number of transactions occurring total time taken by event execution: 479.8171 s -- sum of time consumed by all transactions (parallel factors not considered) response time: -- response time Statistics min: 4.27 ms -- minimum time consumed avg: 7.16 ms -- average time consumed max: 13.80 ms -- maximum time consumed approx. 99 percentile: 9.88 ms -- over 99% average time consumed Threads fairness: events (avg/stddev): 8377.0000/44.33 execution time (avg/stddev): 59.9771/0.00

From: http://imysql.com/2014/10/17/sysbench-full-user-manual.shtml

Address: http://www.linuxprobe.com/performance-test-sysbench.html


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.