4. Perform OLTP TestingOn the basis of the above initialization data parameters, add some parameters to start the test:
./sysbench --mysql-host=127.0.0.1 --mysql-port=3306 \--mysql-user=tpcc --mysql-password=tpcc \--test=tests/db/oltp.lua --oltp_tables_count=10 \ --oltp-table-size=10000000 --num-threads=8 \ --oltp-read-only=off --report-interval=10 \ --rand-type=uniform --max-time=3600 \ --mysql-table-engine=myisam --max-requests=0 \ --percentile=99 run >> ./log/sysbench_oltpX_8_20140921.log
Explanations of these parameters:
-- Num-threads = 8 indicates that eight concurrent connections are initiated -- oltp-read-only = off indicates that read-only tests are not performed, that is to say, the mixed read/write mode test -- report-interval = 10 indicates that the Test Progress report is output every 10 seconds -- rand-type = uniform indicates that the random type is set to the fixed mode, other optional random modes: uniform (fixed), gaussian (gaussian), special (specific) -- max-time = 120 indicates the maximum execution duration of 120 seconds -- max-requests = 0 indicates that the total number of requests is 0, because the total execution duration has been defined above, therefore, the total number of requests can be set to 0. You can also set only the total number of requests, without setting the maximum execution duration -- percentile = 99 indicates setting the sampling ratio. The default value is 95%, that is, the 1% long request is discarded. In the remaining 99%, the maximum value -- mysql-table-engine = myisam indicates that the tested table storage engine type is myisam.
That is, the concurrent OLTP test is simulated for 10 tables. Each table has 10 million rows of records and the stress test duration is 1 hour.
It is recommended that the duration of continuous stress testing be no less30 minutes. Otherwise, the test data may be meaningless.
It should be noted that the parameter on the official website is incorrect, that is, -- mysql-table-engine, which is written on the official website -- mysql-table-type, this should be caused by no timely updates.
In addition, the -- mysql-table-engine parameter can be specified as a table storage engine type supported by MySQL, such as innodb.
5. Interpretation of test resultsThe test results are described as follows:
Sysbench 0.5: multi-threaded system evaluation benchmarkRunning the test with following options: Number of threads: 8 Report intermediate results every 10 second (s) random number generator seed is 0 and will be ignoredThreads started! -- The test results are reported every 10 seconds. tps, read per second, write per second, response time of more than 99% [10 s] threads: 8, tps: 1111.51, reads/s: 15568.42, writes/s: 4446.13, response time: 9.95 ms (99%) [20 s] threads: 8, tps: 1121.90, reads/s: 15709.62, writes/s: 4487.80, response time: 9.78 ms (99%) [30 s] threads: 8, tps: 1120.00, reads/s: 15679.10, writes/s: 4480.20, response time: 9.84 ms (99%) [40 s] threads: 8, tps: 1114.20, reads/s: 15599.39, writes/s: 4456.30, response time: 9.90 ms (99%) [50 s] threads: 8, tps: 1114.00, reads/s: 15593.60, writes/s: 4456.70, response time: 9.84 ms (99%) [60 s] threads: 8, tps: 1119.30, reads/s: 15671.60, writes/s: 4476.50, response time: 9.99 ms (99%) OLTP test statistics: queries saved med: read: 938224 -- total read write: 268064 -- total write count other: 134032 -- total number of other operations (operations other than SELECT, INSERT, UPDATE, and DELETE, such as COMMIT) total: 1340320 -- total number of transactions: 67016 (1116.83 per sec .) -- total transactions (transactions per second) deadlocks: 0 (0.00 per sec .) -- total number of deadlocks read/write requests: 1206288 (20103.01 per sec .) -- total read/write count (Reads/writes per second) other operations: 134032 (2233.67 per sec .) -- total number of other operations (other operations per second) General statistics: -- some statistical results total time: 60.0053 s -- total time consumed total number of events: 67016 -- total number of transactions occurring total time taken by event execution: 479.8171 s -- sum of time consumed by all transactions (parallel factors not considered) response time: -- response time Statistics min: 4.27 ms -- minimum time consumed avg: 7.16 ms -- average time consumed max: 13.80 ms -- maximum time consumed approx. 99 percentile: 9.88 ms -- over 99% average time consumed Threads fairness: events (avg/stddev): 8377.0000/44.33 execution time (avg/stddev): 59.9771/0.00
From: http://imysql.com/2014/10/17/sysbench-full-user-manual.shtml
Address: http://www.linuxprobe.com/performance-test-sysbench.html