zoukankan      html  css  js  c++  java
  • 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

  • 相关阅读:
    GeoServer 2.2 正式版发布,GIS 服务器
    Spring Shell 1.0.0.RC1 发布
    微软发布支持Windows Desktop和F#的Visual Studio Express版本
    XINS 3.0 正式版发布,远程 API 调用规范
    YUI 3.7.2 补丁版发布
    HTML5 Boilerplate 4:改进了Apache配置和图片替换技术,并采用MIT许可证
    解决Windows Phone平台上不能枚举工程自带资源的问题
    截短 UTF8 字符串
    Spring Data Neo4j 2.1.0 RC4 发布
    GTK+ 3.5.18 发布,GUI 开发工具包
  • 原文地址:https://www.cnblogs.com/jinzhenshui/p/15480409.html
Copyright © 2011-2022 走看看