Sysbench-a kind of system performance benchmark

Source: Internet
Author: User
Sysbench-benchmarkSysBench is an open-source, cross-platform, modular, and multi-threaded performance testing tool that runs on databases with high load, you can perform performance tests on CPU/memory/thread/IO/database. Performance parameters used to evaluate the operating system... sysbench-benchmark SysBench is an open-source, cross-platform, modular, and multi-threaded performance testing tool that runs on databases with high load, you can perform performance tests on CPU/memory/thread/IO/database. Used to evaluate the performance parameters of the operating system. 1 sysbench introduction Sysbench allows us to get the system performance overview without using the real complex database benchmark. Currently, major Supported databases include mysql, oracle, and postgresql. The following system performance parameters can be evaluated: 1. cpu performance 2. memory allocation and transmission speed test 3. mutex Test 4. file I/O performance 5. thread Scheduling Performance 6. database Service performance (OLTP benchmark) originally sysbench was mainly written for mysql benchmark. But now SysBench will be further extended to support more database backends, distributed benchmarks and third-party plug-in modules. Sysbench starts threads according to the specified number. each thread establishes a connection with mysql. each thread continuously performs transaction operations, opens transactions, and then performs query, update, and insert operations to commit transactions, start a new transaction. all SQL statements only access one table-sbtest, which is created by the sysbench prepare command. The number of records is also specified and created in prepare. When the test ends, a statistical result is displayed, including the number of transactions per second and the average response time. 2. download and install sysbench. 1. download: http://sourceforge.net/projects/sysbench/ Sysbench-0.4.8.tar.gz source code. Sysbench-0.4.8.tar.gz compilation failed. 2. install the default support for MySQL, if you need to test Oracle/PostgreSQL, you need to add the-with-oracle or-with-pgsql parameter [root @ RedHat sysbench-0.4.8] #. /configure -- without-mysql [root @ RedHat sysbench-0.4.8] # make [root @ RedHat sysbench-0.4.8] # make install if you need to test mysql, you need to configure the parameter options :. /configure -- with-mysql-connector des =/opt/mysql/include/mysql indicates the mysql header file directory -- with-mysql-libs =/opt/mysql/lib/mysql indicates the mysql module directory if the stock lacks libtool, go ftp://ftp.gnu.org/gnu/libtool/ Download 3 performance test and result analysis please refer to sysbench help [root @ RedHat sysbench-0.4.8] # sysbenchMissing required command argument. Usage: sysbench [general-options]... -- test = [Test-options]... command General options: -- num-threads = N number of threads to use [1] -- max-requests = N limit for total number of requests [10000] -- max-time = N limit for total execution time in seconds [0] -- thread-stack-size = SIZE size of stack per thread [32 K] -- init-rng = [on | off] initialize random number generator [off] -- 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 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 Commands: prepare run cleanup help See 'sysbench -- test = Help' for a list of options for each test. [root @ RedHat sysbench-0.4.8] # Description of the common parameter -- num-threads = N number of threads used for testing, the default value is 1 -- max-requests = N. the current value is 1 -- max-requests = N. the default value is running -max-time = N. the default value is 0 -- thread-stack-size = SIZE, the default value is 32 K -- init-rng = [on | off] Whether to initialize the random number generator -- test = STRING running test -- debug = [on | off] whether to print more debug information -- validate = [on | off] whether to perform a validity check -- help = [on | off: STRING description fileio file I/O test CPU performance test mem Ory memory allocation and transmission speed test threads thread subsystem performance test mutex performance test oltp database OLTP test 1. file IO test [root @ RedHat test] # sysbench -- test = fileio helpsysbench v0.4.8: multi-threaded system evaluation benchmark fileio options: -- file-num = N number of files to create [128] -- file-block-size = N block size to use in all IO operations [16384] -- file-total-size = SIZE total size of files to create [2G] -- file-test-mode = STRING test mode {seqwr, Seqrewr, seqrd, rndrd, rndwr, rndrw} -- file-io-mode = STRING file operations mode {sync, async, faw.map, slowmmap} [sync] -- file-extra-flags = STRING additional flags to use on opening files {sync, dsync, direct} [] -- file-fsync-freq = N do fsync () after this number of requests (0-don't use fsync ()) [100] -- file-fsync-all = [on | off] do fsync () after each write operation [off] -- file-fsync-end = [on | off] do f Sync () at the end of test [on] -- file-fsync-mode = STRING which method to use for synchronization {fsync, fdatasync} [fsync] -- file-merged-requests = N merge at most this number of IO requests if poss visible (0-don't merge) [0] -- file-rw-ratio = N reads/writes ratio for combined test [1.5] [root @ RedHat test] # Parameter options: parameter name description -- file-num = N indicates the number of files created. the default value is 128. -- file-block-size = N indicates the block size in all IO operations, default value: 16384 -- file-total-si Ze = SIZE: total SIZE of the created file. the default value is 2 GB -- file-test-mode = STRING test access mode. you can select the following six parameters: seqwr (sequential write) /seqrewr (sequential read/write)/seqrd (sequential read)/rndwr (random write)/rndrw (random read/write)/rndrd (random read ); -- file-io-mode = STRING file operation mode. There are four options: sync, async, faw.map, slowmmap defaults to sync -- file-extra-flags = STRING indicates the ID of the file to be opened. the following options are available: sync, dsync, direct -- file-fsync-freq = N executes fsync () after N requests. the default value is. 0 indicates that fsync () is not executed () -- file-fsync-all = [on | off] whether to execute fsync () after each write operation () -- file-fsync-end = [on | off] fsyn is executed at the end of the test. C (). by default, the -- file-fsync-mode = STRING synchronization method is enabled: fsync, fdatasync, the default value is fsync -- file-merged-requests = N. try to merge N requests as much as possible. 0 indicates that the requests are not merged. the default value is 0 -- file-rw-ratio = N. the default value is 1.5: 1 test case: create two processes, the total size of the created files is 3 GB, and the file read/write mode is random read. Read/write speeds can be obtained ~ [Root @ RedHat test] # sysbench -- test = fileio -- num-threads = 2 -- file-total-size = 512 M -- file-test-mode = rndrw prepare (prepare the test file)) sysbench v0.4.8: multi-threaded system evaluation benchmark 128 files, 4096Kb each, 512 Mb totalCreating files for the test... [root @ RedHat test] # sysbench -- test = fileio -- num-threads = 2 -- file-total-size = 512 M -- file-test-mode = rndrw run (run the test) sysbench v0.4.8: multi-threaded system e Valuation benchmark Running the test with following options: Number of threads: 2 Extra file open flags: 0128 files, 4 Mb each512Mb total file sizeBlock size 16 KbNumber of random requests for random IO: 10000 Read/Write ratio for combined random IO test: 1.50 Periodic FSYNC enabled, calling fsync () each 100 requests. calling fsync () at the end of test, Enabled. using synchronous I/O modeDoing random r/w TestThreads started! Done. operations completed MED: 6000 Read, 4000 Write, 12800 Other = 22800 TotalRead 93.75 Mb Written 62.5 Mb Total transferred 156.25 Mb (3.2979 Mb/sec) 211.07 Requests/sec executed Test execution summary: total time: 47.3783 s total number of events: 10000 total time taken by event execution: 36.6912 per-request statistics: min: 0.0000 s avg: 0.0037 s max: 0.2687 s approx. 95 percentile: 0.0230 s Threads fair Ness: events (avg/stddev): 5000.0000/180.00 execution time (avg/stddev ): 18.3456/0.19 [root @ RedHat test] # sysbench -- test = fileio -- num-threads = 2 -- file-total-size = 512 M -- file-test-mode = rndrw cleanup (clear test files) sysbench v0.4.8: multi-threaded system evaluation benchmark Removing test files... [root @ RedHat test] #2. CPU performance test Sysbench uses the method of finding the maximum prime number to test CPU performance: [root @ RedHat ~] # Sysbench -- test = cpu helpsysbench v0.4.8: multi-threaded system evaluation benchmark cpu options: -- cpu-max-prime = N upper limit for primes generator [10000] [root @ RedHat ~] # Parameter resolution parameter description -- maximum limit of cpu-max-prime = N prime number; default value: 10000; test case [root @ RedHat ~] # Sysbench -- test = cpu -- cpu-max-prime = 20000 runsysbench v0.4.8: multi-threaded system evaluation benchmarkRunning the test with following options: Number of threads: 1 Doing CPU performance benchmarkThreads started! Done. maximum prime number checked in CPU test: 20000 Test execution summary: total time: 124.1761 s total number of events: 10000 total time taken by event execution: 123.3658 per-request statistics: min: 0.0051 s avg: 0.0123 s max: 0.1908 s approx. 95 percentile: 0.0171 s Threads fairness: events (avg/stddev): 10000.0000/0.00 execution time (avg/stddev): 123.3658/0.00 [root @ RedHat ~] #3. test the memory performance [root @ RedHat ~] # Sysbench -- test = memory helpsysbench v0.4.8: multi-threaded system evaluation benchmark memory options: -- memory-block-size = SIZE size of memory block for test [1 K] -- memory-total-size = SIZE total size of data to transfer [100G] -- memory-scope = STRING memory access scope {global, local} [global] -- memory-hugetlb = [on | off] allocate memory from HugeTLB pool [off] -- memory-memory = STRING type of memory opera Tions {read, write, none} [write] -- memory-access-mode = STRING memory access mode {seq, rnd} [seq] [root @ RedHat ~] # Parameter name description -- memory-block-size = SIZE memory block size. the default value is 1 K -- memory-total-SIZE = size, the default value is 100 GB -- memory-scope = STRING. whether the memory access is local or global, the default value is global -- memory-hugetlb = [on | off] allocating memory from hugetlb -- memory-memory = STRING memory operation type: read, write, none, the default value is -- memory-access-mode = STRING memory access mode seq and rnd. the default value is seq; [root @ RedHat test] # sysbench -- test = memory -- memory-block-size = 4 k -- memory-total-size = 64 M run 4. thread performance test [root @ RedHat ~] # Sysbench -- test = threads helpsysbench v0.4.8: multi-threaded system evaluation benchmark threads options: -- thread-yields = N number of yields to do per request [1000] -- thread-locks = N number of locks per thread [8] [root @ RedHat ~] # Parameter description -- thread-yields = N memory block size. the default value is 1 K -- thread-locks = N, the default value is 100 GB test case [root @ RedHat test] # sysbench -- test = threads -- num-threads = 64 -- thread-yields = -- thread-locks = 2 runsysbench v0.4.8: multi-threaded system evaluation benchmark Running the test with following options: Number of threads: 64 Doing thread subsystem performance testThread yields per test: 100 Locks used: 2 Threads started! Done. test execution summary: total time: 24.8159 s total number of events: 10000 total time taken by event execution: 1575.5529 per-request statistics: min: 0.0002 s avg: 0.1576 s max: approx 2.0173 s. 95 percentile: 0.5627 s Threads fairness: events (avg/stddev): 156.2500/12.62 execution time (avg/stddev ): 24.6180/0.08 [root @ RedHat test] #5 mutex performance test [root @ RedHat ~] # Sysbench -- test = mutex helpsysbench v0.4.8: multi-threaded system evaluation benchmark mutex options: -- mutex-num = N total size of mutex array [4096] -- mutex-locks = N number of mutex locks to do per thread [50000] -- mutex-loops = N number of empty loops to do inside mutex lock [10000] [root @ RedHat ~] # Parameter description -- mutex-num = N mutex data size. the default value is 4096 -- mutex-locks = N. the default value is 50000; -- mutex-loops = N number of empty loops in the mutex lock, the default value is 10000 test case [root @ RedHat test] # sysbench -- test = mutex -- num-threads = 16 -- mutex-num = 1024 -- mutex-locks = 10000 -- mutex-loops = 5000 runsysbench v0.4.8: multi-threaded system evaluation benchmark Running the test with following options: Number of threads: 16 Doing mutex performance testThreads started! Done. test execution summary: total time: 0.0482 s total number of events: 16 total time taken by event execution: 0.2271 per-request statistics: min: 0.0015 s avg: 0.0142 s max: approx 0.0312 s. 95 percentile: 0.0126 s Threads fairness: events (avg/stddev): 1.0000/0.00 execution time (avg/stddev ): 0.0142/0.01 [root @ RedHat test] #6 The OLTP test is not analyzed.

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.