• 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

  • 相关阅读:
    MongoDB:数据库管理
    MongoDB:用户管理
    MongoDB:入门
    彻底透析SpringBoot jar可执行原理
    轻松了解Spring中的控制反转和依赖注入(一)
    领域驱动最佳实践--用代码来告诉你来如何进行领域驱动设计
    血的教训--如何正确使用线程池submit和execute方法
    领域驱动设计之实战权限系统微服务
    为什么我们需要领域驱动设计
    【Go入门学习】golang自定义路由控制实现(二)-流式注册接口以及支持RESTFUL
  • 原文地址:https://www.cnblogs.com/jinzhenshui/p/15480409.html
Copyright © 2020-2023  润新知