mysqlslap 性能测试

--create-schema=name 指定测试的数据库名,默认是mysqlslap
--engine=name 创建测试表所使用的存储引擎,可指定多个
--concurrency=N 模拟N个客户端并发执行。可指定多个值,以逗号或者
--number-of-queries=N 总的测试查询次数(并发客户数×每客户查询次数),比如并发是10,总次数是100,那么10个客户端各执行10个
--iterations=N 迭代执行的次数,即重复的次数(相同的测试进行N次,求一个平均值),指的是整个步骤的重复次数,包括准备数据、测试load、清理
--commit=N 执行N条DML后提交一次
--auto-generate-sql, -a # 自动生成测试表和数据,表示用mysqlslap工具自己生成的SQL脚本来测试并发压力。
--auto-generate-sql-loadtype=name# 测试语句的类型。代表要测试的环境是读操作还是写操作还是两者混合的。# 取值包括:read (scan tables), write (insert intotables), key (read primary keys), update (updateprimary keys), or mixed (half inserts, half scanningselects). 默认值是:mixed.
--auto-generate-sql-addauto-increment对生成的表自动添加auto_increment列
--number-char-cols=name 自动生成的测试表中包含N个字符类型的列,默认1
--number-int-cols=name 自动生成的测试表中包含N个数字类型的列,默认1
--debug-info 打印内存和CPU的信息

测试同时不同的存储引擎的性能进行对比:并发50-100,1000次查询
mysqlslap -a --concurrency=50,100 --number-of-queries 1000 --iterations=5 --engine=myisam,innodb --debug-info
mysqlslap -a --concurrency=50,100 --number-of-queries 3000 --iterations=5 --auto-generate-sql --auto-generate-sql-add-auto-increment --engine=ndbcluster --debug-info

猜你喜欢

转载自www.cnblogs.com/qin1993/p/12082769.html