Sysbench multi-thread performance testing tool _ MySQL

Source: Internet
Author: User
Sysbench multi-thread performance testing tool bitsCN.com recently used sysbench for many performance tests. it also summarizes its features and usage and precautions. Sysbench is a multi-thread performance testing tool that can perform performance tests such as CPU, memory, IO, and database. However, most of the time I use it to perform oltp tests on databases (MySQL. What can it test and how can it help me to answer the question.
~ /Zbs $ sysbench -- help
Missing required command argument.
Usage:
Sysbench [general-options]... -- test = [Test-options]... command
In the above general usage, -- test = specifies the type to be tested. what types of -- test are available? Fileio/cpu/memory/threads/mutex. sorry, I have never tested the above. I mainly use it to test the database performance, but why is there no database option, I used the latest version 0.5. The biggest difference between it and 0.4 is that it supports multi-table testing, real-time printing of statistics, and custom lua scripts to set test behaviors.
Compiled-in tests:
Fileio-File I/O test
Cpu-CPU performance test
Memory-Memory functions speed test
Threads-Threads subsystem performance test
Mutex-Mutex performance test
If you use sysbench0.4, you will probably see the following. Note that the oltp option is used for database testing.
Compiled-in tests:
Fileio-File I/O test
Cpu-CPU performance test
Memory-Memory functions speed test
Threads-Threads subsystem performance test
Mutex-Mutex performance test
Oltp-OLTP test
After reading the test mode, what other control parameters does it have? First, let's take a look at sysbench -- test =. Help, for example, here (please note that because the -- test option of sysbench0.5 does not use the oltp option for database testing, it is specified by the lua script, therefore, the following results cannot be viewed using the preceding command. if you want to view the result, you can still use 0.4. if anyone finds the way to view the oltp parameters in Version 0.5, please let us know. In addition, although versions 0.5 and 0.4 are different, the parameters are basically compatible ):
~ $ Sysbench -- test = oltp help
Sysbench 0.4.12: multi-threaded system evaluation benchmark
Oltp options:
-- Oltp-test-mode = STRING test type to use {simple, complex, nontrx, sp} [complex]
-- Oltp-reconnect-mode = STRING reconnect mode {session, transaction, query, random} [session]
-- Oltp-sp-name = STRING name of store procedure to call in SP test mode []
-- Oltp-read-only = [on | off] generate only 'read' queries (do not modify database) [off]
-- Oltp-skip-trx = [on | off] skip BEGIN/COMMIT statements [off]
-- Oltp-range-size = N range size for range queries [100]
-- Oltp-point-selects = N number of point selects [10]
-- Oltp-simple-ranges = N number of simple ranges [1]
-- Oltp-sum-ranges = N number of sum ranges [1]
-- Oltp-order-ranges = N number of ordered ranges [1]
-- Oltp-distinct-ranges = N number of distinct ranges [1]
-- Oltp-index-updates = N number of index update [1]
-- Oltp-non-index-updates = N number of non-index updates [1]
-- Oltp-nontrx-mode = STRING mode for non-transactional test {select, update_key, update_nokey, insert, delete} [select]
-- Oltp-auto-inc = [on | off] whether AUTO_INCREMENT (or equivalent) shocould be used on id column [on]
-- Oltp-connect-delay = N time in microseconds to sleep after connection to database [10000]
-- Oltp-user-delay-min = N minimum time in microseconds to sleep after each request [0]
-- Oltp-user-delay-max = N maximum time in microseconds to sleep after each request [0]
-- Oltp-table-name = STRING name of test table [sbtest]
-- Oltp-table-size = N number of records in test table [0, 10000]
-- Oltp-dist-type = STRING random numbers distribution {uniform, gaussian, special} [special]
-- Oltp-dist-iter = N number of iterations used for numbers generation [12]
-- Oltp-dist-pct = N percentage of values to be treated as 'special '(for special distribution) [1]
-- Oltp-dist-res = N percentage of 'special 'values to use (for special distribution) [75]
General database options:
-- Db-driver = STRING specifies database driver to use ('help' to get list of available drivers)
-- Db-ps-mode = STRING prepared statements usage mode {auto, disable} [auto]
Compiled-in database drivers:
Mysql-MySQL driver
Mysql options:
-- Mysql-host = [LIST,...] MySQL server host [localhost]
-- Mysql-port = N MySQL server port [0, 3306]
-- Mysql-socket = STRING MySQL socket
-- Mysql-user = STRING MySQL user [sbtest]
-- Mysql-password = STRING MySQL password []
-- Mysql-db = STRING MySQL database name [sbtest]
-- Mysql-table-engine = STRING storage engine to use for the test table {myisam, innodb, bdb, heap, ndbcluster, federated} [innodb]
-- Mysql-engine-trx = STRING whether storage engine used is transactional or not {yes, no, auto} [auto]
-- Mysql-ssl = [on | off] use SSL connections, if available in the client library [off]
-- Myisam-max-rows = N max-rows parameter for MyISAM tables [0, 1000000
-- Mysql-create-options = STRING additional options passed to create table []
There are so many parameters, I believe they can be basically understood. I will discuss the meaning of the parameters in the examples below. After knowing how to view the usage of a specific test mode, let's take a look at general-options and common parameters. let's take a look at the 0.5 parameter (a lot more than 0.4 is added, and some parameter names have also changed, how to identify --- explain a parameter exactly ):
General options:
-- Num-threads = N number of threads to use [1]
-- Max-requests = N limit for total number of requests [1, 10000]
-- Max-time = N limit for total execution time in seconds [0]
-- Forced-shutdown = STRING amount of time to wait after -- max-time before forcing shutdown [off]
-- Thread-stack-size = SIZE size of stack per thread [64 K]
-- Tx-rate = N target transaction rate (tps) [0]
-- Report-interval = N periodically report intermediate statistics with a specified interval in seconds. 0 disables intermediate reports [0]
-- Report-checkpoints = [LIST,...] dump full statistics and reset all counters at specified points in time. the argument is a list of comma-separated values representing the amount of time in seconds elapsed from start of test when report checkpoint (s) must be completed Med. report checkpoints are off by default. []
-- Test = STRING test to run
-- Debug = [on | off] print more debugging info [off]
-- Validate = [on | off] perform validation checks where possible [off]
-- Help = [on | off] print help and exit
-- Version = [on | off] print version and exit [off]
-- Rand-init = [on | off] initialize random number generator [off]
-- Rand-type = STRING random numbers distribution {uniform, gaussian, special, and pareto} [special]
-- Rand-spec-iter = N number of iterations used for numbers generation [12]
-- Rand-spec-pct = N percentage of values to be treated as 'special '(for special distribution) [1]
-- Rand-spec-res = N percentage of 'special 'values to use (for special distribution) [75]
-- Rand-seed = N seed for random number generator, ignored when 0 [0]
-- Rand-proxy-h = N parameter h for proxydistibution [0.2] bitsCN.com

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.