Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install mysql sysbench1.0.3 and test system stress

2025-01-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

Today, I will talk to you about how to carry out mysql sysbench1.0.3 installation and system stress testing, many people may not know much about it. In order to make you understand better, the editor has summarized the following content for you. I hope you can get something according to this article.

Stress testing for the system and database is a must before the project is online, here is the use of the latest version of sysbench stress test use details. Sysbench can do system-level stress testing (CPU, memory, hard disk IO, mutex, Thead), as well as database (MySQL/Oracle/PG) level stress testing. Easy to install and easy to operate, it is one of the important tools used in pressure testing.

1. Sysbench download

Project address: https://launchpad.net/sysbench

Download address: https://github.com/akopytov/sysbench/archive/1.0.3.tar.gz

II. Sysbench installation

[root@DB_TEST tools] # tar-xzvf sysbench-1.0.3.tar.gz

[root@DB_TEST tools] # cd sysbench-1.0.3

[root@DB_TEST sysbench-1.0.3] #. / autogen.sh

[root@DB_TEST sysbench-1.0.3] # / configure-- prefix=/usr/local/sysbench-- with-mysql

[root@DB_TEST sysbench-1.0.3] # make

[root@DB_TEST sysbench-1.0.3] # make install

[root@DB_TEST sysbench-1.0.3] # cp-rp / usr/local/sysbench/bin/sysbench / usr/bin/

[root@DB_TEST sysbench-1.0.3] # / usr/local/sysbench/bin/sysbench-- help

Click (here) to collapse or open

[root@BJ-133-22 sysbench-1.0.3] # / usr/local/sysbench/bin/sysbench-- help

Usage:

Sysbench [options]... [testname] [command]

Commands implemented by most tests: prepare run cleanup help

General options:

-- threads=N number of threads to use [1]

-- events=N limit for total number of events [0]

-- time=N limit for total execution time in seconds [10]

-- forced-shutdown=STRING number of seconds to wait after the-- time limit before forcing shutdown, or 'off' to disable [off]

-- thread-stack-size=SIZE size of stack per thread [64K]

-- rate=N average transactions rate. 0 for unlimited rate [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 performed. Report checkpoints are off by default. []

-- debug [= on | off] print more debugging info [off]

-- validate [= on | off] perform validation checks where possible [off]

-- help [= on | off] print help and exit [off]

-- version [= on | off] print version and exit [off]

-- config-file=FILENAME File containing command line options

-- tx-rate=N deprecated alias for-- rate [0]

-- max-requests=N deprecated alias for-- events [0]

-- max-time=N deprecated alias for-- time [0]

-- num-threads=N deprecated alias for-- threads [1]

Pseudo-Random Numbers Generator options:

-- rand-type=STRING random numbers distribution {uniform,gaussian,special,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. When 0, the current time is used as a RNG seed. [0]

-- rand-pareto-h=N parameter h for pareto distibution [0.2]

Log options:

-- verbosity=N verbosity level {5-debug, 0-only critical messages} [3]

Percentile=N percentile to calculate in latency statistics (1-100) Use the special value of 0 to disable percentile calculations [95]

-- histogram [= on | off] print latency histogram in report [off]

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]

-- db-debug [= on | off] print database-specific debug information [off]

Compiled-in database drivers:

Mysql-MySQL driver

Mysql options:

-- mysql-host= [LIST,...] MySQL server host [localhost]

-- mysql-port= [LIST,...] MySQL server port [3306]

-- mysql-socket= [LIST,...] MySQL socket

-- mysql-user=STRING MySQL user [sbtest]

-- mysql-password=STRING MySQL password []

-- mysql-db=STRING MySQL database name [sbtest]

-- mysql-ssl [= on | off] use SSL connections, if available in the client library [off]

-- mysql-ssl-cipher=STRING use specific cipher for SSL connections []

-- mysql-compression [= on | off] use compression, if available in the client library [off]

-- mysql-debug [= on | off] trace all client library calls [off]

-- mysql-ignore-errors= [LIST,...] List of errors to ignore, or "all" [1213pr. 1020j1205]

-- mysql-dry-run [= on | off] Dry run, pretend that all MySQL client API calls are successful without executing them [off]

Compiled-in tests:

Fileio-File I do O test

Cpu-CPU performance test

Memory-Memory functions speed test

Threads-Threads subsystem performance test

Mutex-Mutex performance test

See 'sysbench help' for a list of options for each test.

III. Use of sysbench

1. CPU performance test

Cpu performance test: find the maximum prime number in the range {the shorter the time, the better.

The cpu performance test is mainly based on the addition operation of primes. Here, the maximum prime number (prime number) is specified as 80000 quotient (prime number) = `grep "processor" / proc/cpuinfo | wc-l` specifies the number of threads. The default is 1.

/ usr/local/sysbench/bin/sysbench-test=cpu-cpu-max-prime=80000 run

Click (here) to collapse or open

[root@db_test] # / usr/local/sysbench/bin/sysbench-- test=cpu-- cpu-max-prime=80000 run

WARNING: the-- test option is deprecated. You can pass a script name or path on the command line without any options.

Sysbench 1.0.3 (using bundled LuaJIT 2.1.0-beta2)

Running the test with following options:

Number of threads: 1

Initializing random number generator from current time

Prime numbers limit: 80000

Initializing worker threads...

Threads started!

General statistics:

Total time: 10.0057s

Total number of events: 520

Latency (ms):

Min: 18.74

Avg: 19.24

Max: 19.39

95th percentile: 19.29

Sum: 10005.32

Threads fairness:

Events (avg/stddev): 520.00000.00

Execution time (avg/stddev): 10.0053 Universe 0.00

The actual CPU copying machine stress test script is as follows:

Echo-e "conduct CPU stress test: find the maximum prime number less than 10 million, the number of concurrent threads is 10, and the maximum number of requests is 100"

/ usr/local/bin/sysbench-num-threads=10-max-requests=100-test=cpu-debug-cpu-max-prime=10000000 run

2. Memory performance test

When sysbench tests memory, it reads or writes memory sequentially. Depending on the options, each thread can get global or local blocks of data during each operation.

Memory: transfer a certain amount of data throughput at different block sizes {the bigger the better}

Click (here) to collapse or open

[root@db_test fileio] # / usr/local/sysbench/bin/sysbench-- test=memory help

WARNING: the-- test option is deprecated. You can pass a script name or path on the command line without any options.

Sysbench 1.. 3 (using bundled LuaJIT 2.1.-beta2)

Memory options:

-- memory block size during memory-block-size=SIZE size of memory block for test [1K] testing

-- Total data size transmitted by memory-total-size=SIZE total size of data to transfer [100g]

-- memory-scope=STRING memory access scope {global,local} [global] memory access range

-- memory-hugetlb [= on | off] allocate memory from HugeTLB pool [off] from

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report