MySQL压力测试工具 mysqlslap

mysqlslap是一个mysql官方提供的压力测试工具。以下是比较重要的参数:
–-defaults-file,配置文件存放位置
–-concurrency,并发数
–-engines,引擎
–-iterations,迭代的实验次数
–-socket,socket文件位置

自动测试:
-–auto-generate-sql,自动产生测试SQL
–-auto-generate-sql-load-type,测试SQL的类型。类型有mixed,update,write,key,read。
–-number-of-queries,执行的SQL总数量
–-number-int-cols,表内int列的数量
–-number-char-cols,表内char列的数量

例如:
shell>mysqlslap –-defaults-file=/u01/mysql1/mysql/my.cnf –-concurrency=50,100 –-iterations=1 –-number-int-cols=4 –-auto-generate-sql –auto-generate-sql-load-type=write –-engine=myisam -–number-of-queries=200   -S/tmp/mysql.sock
Benchmark
Running for engine myisam
Average number of seconds to run all queries: 0.016 seconds
Minimum number of seconds to run all queries: 0.016 seconds
Maximum number of seconds to run all queries: 0.016 seconds
Number of clients running queries: 50
Average number of queries per client: 4

Benchmark
Running for engine myisam
Average number of seconds to run all queries: 0.265 seconds
Minimum number of seconds to run all queries: 0.265 seconds
Maximum number of seconds to run all queries: 0.265 seconds
Number of clients running queries: 100
Average number of queries per client: 2

指定数据库的测试:
–create-schema,指定数据库名称
–query,指定SQL语句,可以定位到某个包含SQL的文件

例如:
shell>mysqlslap –defaults-file=/u01/mysql1/mysql/my.cnf –concurrency=25,50 –iterations=1 –create-schema=test –query=/u01/test.sql -S/tmp/mysql1.sock
Benchmark
Average number of seconds to run all queries: 0.018 seconds
Minimum number of seconds to run all queries: 0.018 seconds
Maximum number of seconds to run all queries: 0.018 seconds
Number of clients running queries: 25
Average number of queries per client: 1

Benchmark
Average number of seconds to run all queries: 0.011 seconds
Minimum number of seconds to run all queries: 0.011 seconds
Maximum number of seconds to run all queries: 0.011 seconds
Number of clients running queries: 50
Average number of queries per client: 1

如果提示参数有错误的话,再参数前面多加一个-符号,连续两个符号就可以了.

项目主页:http://dev.mysql.com/doc/refman/5.1/en/mysqlslap.html

43 thoughts on “MySQL压力测试工具 mysqlslap

  1. Pingback: Home Inspection Champaign IL

  2. Pingback: p2962#https://bizhub24.pl/forum/rozne-f6/jakie-suplementy-polecacie-t340.html#p2962

  3. Pingback: xe88 apk

  4. Pingback: รวม หนี้ เป็น ก้อน เดียว

  5. Pingback: แทงบอลออนไลน์

  6. Pingback: 你吃饭了吗 你多吃一点慢走我跟你讲 请问一下

  7. Pingback: 온라인카지노

  8. Pingback: indoqq

  9. Pingback: www.1mainqq.site

  10. Pingback: site

  11. Pingback: XE88 Download For Android And iOS Iphone

  12. Pingback: ty le ca cuoc bong da

  13. Pingback: estared.net

  14. Pingback: cbd oil

  15. Pingback: porn

  16. Pingback: medicare Plan

  17. Pingback: Ignou Synopsis

  18. Pingback: 메이저사이트

  19. Pingback: satta king

  20. Pingback: travesti

  21. Pingback: Furnace Repairs

  22. Pingback: new york seo

  23. Pingback: Phim 18 Han Quoc

  24. Pingback: copy Hublot Chronograph

  25. Pingback: satta king

  26. Pingback: 토토사이트

  27. Pingback: 카지노 사이트

  28. Pingback: Vanilla gift

  29. Pingback: 918kiss latest version download 2020

  30. Pingback: 바카라 사이트 무료 쿠폰

  31. Pingback: PlayerUnknown\'s Battlegrounds hacks

  32. Pingback: paito warna sydney

  33. Pingback: airport taxis milton keynes

  34. Pingback: Bitcoin Scam

  35. Pingback: 안전바카라

  36. Pingback: 먹튀검증-319

  37. Pingback: cheapest 100 viagra us

  38. Pingback: levitra or viagra

  39. Pingback: شات العرب

  40. Pingback: keto diet review

  41. Pingback: เงินด่วน ได้จริง

  42. Pingback: ไลน์ เงินด่วน

  43. Pingback: buy hydroxychloroquine online

Comments are closed.