• Mysql:mysqlslap:应用案例:持续补充 ...


    案例1:测试服务器可支撑的简单连接数上限是多少 

    你可以不断调整 -c参数,注意执行总测试数--number-of-queries必须要大于等于-c的并发线程数量

    [mysql@6CU3515V29 ~]$ mysqlslap -h10.1.101.3 -uroot -proot -e innodb -c50 --create-schema=test --no-drop --query='select sleep(3)' --number-of-queries=501
    mysqlslap: [Warning] Using a password on the command line interface can be insecure.
    Benchmark
        Running for engine innodb
        Average number of seconds to run all queries: 30.009 seconds
        Minimum number of seconds to run all queries: 30.009 seconds
        Maximum number of seconds to run all queries: 30.009 seconds
        Number of clients running queries: 50
        Average number of queries per client: 10
    
    [mysql@6CU3515V29 ~]$ 

    案例2:测试服务器写入能力——即全部insert能力 

    你可以不断调整 -c参数,--auto-generate-sql-load-type=write,则mysqlslap会以多线程方式全力insert数据!

    [mysql@6CU3515V29 ~]$ mysqlslap -h10.1.101.3 -uroot -proot -e innodb -c50 -a -x15 -y15 --auto-generate-sql-guid-primary --auto-generate-sql-secondary-indexes=0 --auto-generate-sql-write-number=1 --auto-generate-sql-load-type=write --auto-generate-sql-execute-number=1000  --auto-generate-sql-unique-write-number=1000 --auto-generate-sql-unique-query-number=100 --no-drop
    mysqlslap: [Warning] Using a password on the command line interface can be insecure.
    Benchmark
        Running for engine innodb
        Average number of seconds to run all queries: 2.527 seconds
        Minimum number of seconds to run all queries: 2.527 seconds
        Maximum number of seconds to run all queries: 2.527 seconds
        Number of clients running queries: 50
        Average number of queries per client: 1000
    
    [mysql@6CU3515V29 ~]$ 

    案例3:测试服务器读(全表读、随机id读)能力——即全部select能力

    你可以不断调整 -c参数,--auto-generate-sql-load-type=key,则mysqlslap会以多线程方式全力insert数据!

    注意:--auto-generate-sql-load-type=read 是个垃圾的参数,因为它是不带任何条件的全表select,实际没有意义,测试结果也没多大意义

    [mysql@6CU3515V29 ~]$ mysqlslap -h10.1.101.3 -uroot -proot -e innodb -c100 -a --auto-generate-sql-write-number=55555  --auto-generate-sql-guid-primary   --auto-generate-sql-load-type=key  --auto-generate-sql-execute-number=333333
    mysqlslap: [Warning] Using a password on the command line interface can be insecure.
    Benchmark
        Running for engine innodb
        Average number of seconds to run all queries: 145.053 seconds
        Minimum number of seconds to run all queries: 145.053 seconds
        Maximum number of seconds to run all queries: 145.053 seconds
        Number of clients running queries: 100
        Average number of queries per client: 333333
    
    [mysql@6CU3515V29 ~]$ 
    --no-drop 
  • 相关阅读:
    pydoc (Development Tools) – Python 中文开发手册
    CSS :out-of-range 选择器
    wcschr (Strings) – C 中文开发手册
    gl (SGI IRIX) – Python 中文开发手册
    排版 | Typography (CSS) – Bootstrap 3 中文开发手册
    HTML 音频,视频 DOM ended 属性
    ASP.NET Web Forms 教程
    Linux 系统目录结构
    ADO Connection 对象
    JavaWeb 之 HttpServletRequest 类
  • 原文地址:https://www.cnblogs.com/jinzhenshui/p/15476396.html
Copyright © 2020-2023  润新知