Benchmark
Running for engine innodb
Average number of seconds to run all queries: 0.701 seconds
Minimum number of seconds to run all queries: 0.632 seconds
Maximum number of seconds to run all queries: 0.778 seconds
Number of clients running queries: 50
Average number of queries per client: 4
Benchmark
Running for engine innodb
Average number of seconds to run all queries: 0.754 seconds
Minimum number of seconds to run all queries: 0.560 seconds
Maximum number of seconds to run all queries: 0.920 seconds
Number of clients running queries: 100
Average number of queries per client: 2
Benchmark
Running for engine innodb
Average number of seconds to run all queries: 0.860 seconds
Minimum number of seconds to run all queries: 0.709 seconds
Maximum number of seconds to run all queries: 1.173 seconds
Number of clients running queries: 200
Average number of queries per client: 1
[root@node2 bin]#
说明:测试50,100,200个并发,运行20次,存储引擎myisam和innodb,运行200次查询
4.测试实例(自定义sql语句)
[root@node2 bin]# ./mysqlslap --concurrency=100 --iterations=1 --query='select * from tong.t;' --number-of-queries=10 --debug-info -uroot -psystem
Benchmark
Average number of seconds to run all queries: 2.211 seconds
Minimum number of seconds to run all queries: 2.211 seconds
Maximum number of seconds to run all queries: 2.211 seconds
Number of clients running queries: 100
Average number of queries per client: 0
User time 0.05, System time 0.27
Maximum resident set size 7324, Integral resident set size 0
Non-physical pagefaults 1686, Physical pagefaults 33, Swaps 0
Blocks in 7104 out 0, Messages in 0 out 0, Signals 0
Voluntary context switches 3449, Involuntary context switches 40
[root@node2 bin]#
5.测试实例(检测脚本)
[root@node2 bin]# ./mysqlslap --create=/yourpath/Test1.sql --query=/yourpath/Test2.sql --concurrency=50,100,200 --iterations=20 --engine=myisam,innodb -u root -psystem