Database tool sysbench installation tutorial and performance test example, sysbench performance test

Source: Internet
Author: User

Database tool sysbench installation tutorial and performance test example, sysbench performance test

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.

I. Installation

First, download the source package in the http://sourceforge.net/projects/sysbench.
Next, follow the steps below to install:
Copy codeThe Code is as follows:
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:
Copy codeThe Code is 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 in your MySQL lib directory. If not, you can download devel or share package for installation.

In addition, if you want sysbench to support pgsql/oracle, you need to add parameters during compilation.
-- With-pgsql
Or
-- With-oracle
These two parameters are disabled by default, and only MySQL supports them by default.

2. Start testing

After the compilation is successful, it is necessary to test various performances. The test methods are also mentioned on the website, but the OLTP test is not accurate enough. Here I will roughly mention:

1. cpu performance test
Copy codeThe Code is as follows: sysbench -- test = cpu -- cpu-max-prime = 20000 run
In the preceding example, the maximum prime number is 20000. You can adjust the value based on the cpu performance.

2. thread testing
Copy codeThe Code is as follows:
Sysbench -- test = threads -- num-threads = 64 -- thread-yields = 100 -- thread-locks = 2 run
3. Disk I/O performance test
Copy codeThe Code is as follows:
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
Copy codeThe Code is as follows: 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
Copy codeThe Code is as follows:
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. Note that the parameter on the official website is incorrect, that is, mysql-table-engine, mysql-table-type is written on the official website. This should be caused by the failure of 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. When testing OLTP, 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.

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


What is the impact of disk I/O on database performance?

It depends on the bottleneck of your database. I/O is improved, but it is not because the memory is not enough or the CPU cannot be processed. Check the CPU wait time. vmstat 1 What is your sysbench statement?
 
How does the database and development tools used by the development and management information system work together? Why? Use a specific example to describe

First of all, the 1st principle is that database selection should not be based on development tools, but should be considered based on data volume, performance, and network environment.
2nd principles, familiarity with principles, your technical reserves, and technical advantages. Especially the optimization of large databases in the later stage
Finally, we should consider the combination with development tools. For example, MSSQLSERVER is the best choice for. NET.

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.