随笔 - 746  文章 - 0  评论 - 39  阅读 - 79万

Mysql:mysqlslap:自带的简单压力测试工具:使用、bug等:续(为了方便阅读)

--number-of-queries参数

首先,该参数限定mysqlslap主线程初始化完成后,所有的、真正的、测试子线程、的累计查询执行次数上限值,是所有测试子线程的累计值

其次,累计次数不能保证是十分精确的,通常指定N,总执行次数就是N,如果没有什么意外抖动的话

然后,特殊的:不指定该参数 or 即该参数的默认值 or 显式设置参数的值为“0”时,它会成为“N=11”,amazing!!! 

最后,当你故意指定参数的值为“<0的负数”时,程序会告诉你,“参数无效,它会自动调整为0”,然后看上面的规则,0成为“N=11”,amazing!!!

复制代码
[mysql@6CU3515V29 ~]$ mysqlslap -h10.1.101.3 -uroot -proot -e innodb -c1 -a -x2 -y2 --auto-generate-sql-add-autoincrement  --auto-generate-sql-secondary-indexes=0 --auto-generate-sql-write-number=1 --auto-generate-sql-load-type=key  --number-of-queries=1   --only-print |grep -i select|wc -l
mysqlslap: [Warning] Using a password on the command line interface can be insecure.
1
[mysql@6CU3515V29 ~]$ mysqlslap -h10.1.101.3 -uroot -proot -e innodb -c1 -a -x2 -y2 --auto-generate-sql-add-autoincrement  --auto-generate-sql-secondary-indexes=0 --auto-generate-sql-write-number=1 --auto-generate-sql-load-type=key  --number-of-queries=2   --only-print |grep -i select|wc -l
mysqlslap: [Warning] Using a password on the command line interface can be insecure.
2
...
[mysql@6CU3515V29 ~]$ mysqlslap -h10.1.101.3 -uroot -proot -e innodb -c1 -a -x2 -y2 --auto-generate-sql-add-autoincrement  --auto-generate-sql-secondary-indexes=0 --auto-generate-sql-write-number=1 --auto-generate-sql-load-type=key  --number-of-queries=11   --only-print |grep -i select|wc -l
mysqlslap: [Warning] Using a password on the command line interface can be insecure.
11
[mysql@6CU3515V29 ~]$ mysqlslap -h10.1.101.3 -uroot -proot -e innodb -c1 -a -x2 -y2 --auto-generate-sql-add-autoincrement  --auto-generate-sql-secondary-indexes=0 --auto-generate-sql-write-number=1 --auto-generate-sql-load-type=key  --number-of-queries=12   --only-print |grep -i select|wc -l
mysqlslap: [Warning] Using a password on the command line interface can be insecure.
12
[mysql@6CU3515V29 ~]$ mysqlslap -h10.1.101.3 -uroot -proot -e innodb -c1 -a -x2 -y2 --auto-generate-sql-add-autoincrement  --auto-generate-sql-secondary-indexes=0 --auto-generate-sql-write-number=1 --auto-generate-sql-load-type=key  --number-of-queries=0   --only-print |grep -i select|wc -l
mysqlslap: [Warning] Using a password on the command line interface can be insecure.
11
...
[mysql@6CU3515V29 ~]$ mysqlslap -h10.1.101.3 -uroot -proot -e innodb -c1 -a -x2 -y2 --auto-generate-sql-add-autoincrement  --auto-generate-sql-secondary-indexes=0 --auto-generate-sql-write-number=1 --auto-generate-sql-load-type=key  --number-of-queries=-1   --only-print |grep -i select|wc -l
mysqlslap: [Warning] Using a password on the command line interface can be insecure.
mysqlslap: [Warning] option 'number-of-queries': value -1 adjusted to 0.
11
[mysql@6CU3515V29 ~]$ mysqlslap -h10.1.101.3 -uroot -proot -e innodb -c1 -a -x2 -y2 --auto-generate-sql-add-autoincrement  --auto-generate-sql-secondary-indexes=0 --auto-generate-sql-write-number=1 --auto-generate-sql-load-type=key  --number-of-queries=-9   --only-print |grep -i select|wc -l
mysqlslap: [Warning] Using a password on the command line interface can be insecure.
mysqlslap: [Warning] option 'number-of-queries': value -9 adjusted to 0.
复制代码

 

-i, --iterations=N参数:测试子线程的重复次数

N默认为1

当N<1时,都会自动调整到默认值1

 

posted on   jinzhenshui  阅读(113)  评论(0编辑  收藏  举报
编辑推荐:
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 【杭电多校比赛记录】2025“钉耙编程”中国大学生算法设计春季联赛(1)
历史上的今天:
2009-10-29 Oracle:解决创建OEM资料库中出错的若干问题

点击右上角即可分享
微信分享提示