Rate This Document
Findability
Accuracy
Completeness
Readability

Sysbench 1.0

Use the Sysbench 1.0 client to log in to the MySQL database server to perform a pressure test. In the test command, specify the name of a lua script built in the Sysbench tool to perform corresponding test items.

The test command is in the following format:

1
sysbench [options]... [testname] [command]

The following is an example of the test command:

1
sysbench --db-driver=mysql --mysql-host=192.168.222.120 --mysql-port=3306 --mysql-user=root --mysql-password=123456 --mysql-db=sysbench --table_size=10000000 --tables=64  --time=180  --threads=6 --report-interval=1 oltp_read_write run
  • The options field is a list of zero or more command line options starting with --. Table 1, Table 2, Table 3, Table 4, and Table 5 describe these options.
  • The testname field indicates the name of the built-in lua script (for example oltp_read_only). For details about the oltp_read_only script, see Sysbench 1.0.
  • The command field specifies the command to be executed by Sysbench. The options include prepare, run, cleanup, and help, which indicate preparing for the test (loading data or creating necessary files), performing the test, clearing data, and displaying usage information. In this example, the command field is run.
Table 1 Common options

Option

Description

Default Value

--threads

Number of threads.

1

--events

Maximum number of requests. If the value is 0, there is no limit.

0

--time

Maximum execution time, in seconds. If the value is 0, there is no limit.

10

--rate

Average transaction rate. If the value is 0, the transaction is executed at the fastest speed.

0

--thread-stack-size

Stack size of each thread.

64K

--report-interval

Interval for periodically reporting intermediate statistics, in seconds. The value 0 disables intermediate reports.

0

--debug

Displays more debugging information.

off

--validate

Validates the test result.

off

--help

Prints the general usage guidance or the introduction to each built-in test mode.

off

--config-file

Provides command parameters in files.

-

Table 2 Log options

Option

Description

Default Value

--verbosity

Log verbosity.

  • 0: displays key information only.
  • 5: displays debugging information.

3

--percentile

Percentile to calculate in latency statistics.

95

--histogram

Displays the delay histogram in the report.

off

Table 3 Pseudo-random number generation options

Option

Description

Default Value

--rand-type

Distribution type of random numbers, which can be uniform, gaussian, special, or pareto.

special

--rand-spec-iter

Number of iterations for generating random numbers.

12

--rand-spec-pct

Percentage of values to be treated as special (valid only for the special type).

1

--rand-spec-res

Percentage of special values (valid only for the special type).

75

--rand-seed

Seed for the random number generator. If the value is 0, the current time is used.

0

-rand-pareto-h

Parameter h for the pareto distribution.

0.2

Table 4 Common database options

Option

Description

Default Value

--db-driver

Database driver.

mysql

--db-ps-mode

Precompilation mode, which can be auto or disable.

auto

--db-debug

Prints database debugging information.

off

Table 5 MySQL options

Option

Description

Default Value

--mysql-host

Host name.

localhost

--mysql-port

Port number.

3306

--mysql-socket

Socket.

-

--mysql-user

User name.

sbtest

--mysql-password

Password.

""

--mysql-db

Database name.

sbtest

--mysql-ssl

SSL connection.

off

--mysql-ssl-cipher

Cipher suite for SSL connections.

""

--mysql-compression

Enables compression.

off

--mysql-debug

Traces all client library calls.

off

--mysql-ignore-errors

List of errors to be ignored.

1213,1020,1205

--mysql-dry-run

Specifies whether a dry run is performed. If no, all MySQL client API calls are assumed to be successful.

off