Sysbench installation and Performance Testing

Source: Internet
Author: User

Sysbench installation and Performance Testing

Http://imysql.cn/node/312

Sysbench is a modular, cross-platform, multi-thread benchmark testing tool used to evaluate the database load of different system parameters.

For details about this project, see: http://sysbench.sourceforge.net.

It mainly includes the following testing methods:

1. cpu Performance

2. Disk I/O performance

3. scheduler Performance

4. Memory Allocation and transmission speed

5. POSIX thread Performance

6. database performance (OLTP benchmark test)

Currently, sysbench mainly supports MySQL, pgsql, and oracle databases.

First, install, download the source package in the http://sourceforge.net/projects/sysbench.

Next, follow the steps below to install:

Tar zxf sysbench-0.4.8.tar.gz cd sysbench-0.4.8./configure & make install strip/usr/local/bin/sysbench

The preceding method is applicable when MySQL is installed in the standard default directory. 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 your MySQL lib directory has a corresponding so file,

If not, you can download the devel or share package to install it.

In addition, if you want sysbench to support pgsql/oracle,

You need to add the parameter -- with-pgsql or -- with-oracle during compilation, which is disabled by default, and only supported by MySQL by default.

2. After testing and compiling, You need to test various performance. The testing methods are also mentioned on the official website,

However, the OLTP test is not accurate enough. Here I will roughly mention:

1. cpu performance test

Sysbench -- test = cpu -- cpu-max-prime = 20000 run cpu test is mainly used for addition of prime numbers. In the preceding example, the maximum prime number is 20000,

You can adjust the value based on the cpu performance.

2. thread testing

Sysbench -- test = threads -- num-threads = 64 -- thread-yields = 100 -- thread-locks = 2 run 3. Disk IO performance test

Sysbench -- test = fileio -- num-threads = 16 -- file-total-size = 3G -- file-test-mode = rndrw prepare sysbench -- test = fileio -- num-threads = 16 -- file-total-size = 3G -- file-test-mode = rndrw run sysbench -- test = fileio -- num-threads = 16 -- file-total-size = 3G -- file -test-mode = rndrw cleanup

The above Parameters specify a maximum of 16 threads, the total size of the created files is 3 GB, and the file read/write mode is random read.

4. Memory Test

Sysbench -- test = memory -- memory-block-size = 8 k -- memory-total-size = 4G run

The above parameter specifies that the entire test process is to transfer 4 GB of data in the memory, each block size is 8 K.

5. OLTP Test

Sysbench -- test = oltp -- mysql-table-engine = myisam -- oltp-table-size = 1000000 \ -- mysql-socket =/tmp/mysql. sock -- mysql-user = test -- mysql-host = localhost \ -- mysql-password = test prepare

The preceding parameter specifies that the table storage engine type for this test is myisam,

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, if the maximum number of records in a table is 1000000, other parameters are well understood, mainly specifying the logon mode.

During OLTP testing,

You can create a database sbtest first, or use the -- mysql-db parameter to specify other databases.

-- Mysql-table-engine can also be specified as a table storage engine supported by MySQL, such as innodb.

Okay, this is the main thing. For more information, visit the home page of the sysbench project.

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.