• MySQL基准测试


    MySQL基准测试工具

    mysqlslap、sysbench、Super Smack

    mysqlslap的使用MySQL官网给出了介绍

    Super Smack是服务器压力测试强有力的工具

    sysbench是MySQL基准测试工具了

    sysbench安装

    直接yum安装

    测试环境

    mysql> SELECT VERSION();
    +-----------+
    | VERSION() |
    +-----------+
    | 5.1.73    |
    +-----------+
    1 row in set (0.00 sec)
    

      

    1:测试CPU

    [root@10-4-5-9 ~]# sysbench --test=cpu --cpu-max-prime=1500 run
    

    2:测试fileio

    首先生成文件用于测试(默认生成128个单个16M共2G的文件)

    [root@10-4-5-9 ~]# sysbench --test=fileio prepare

    读写文件测试

    [root@10-4-5-9 ~]# sysbench --test=fileio --file-test-mode=rndrw run

    每秒请求数:Requests/sec  1841.10

    总体吞吐量:28.767Mb/sec

    删除测试数据:

    [root@10-4-5-9 ~]# sysbench --test=fileio cleanup

      

    3:测试oltp(主要用来测试多线程事务处理)

    首先创建数据库和测试表

    mysql> CREATE DATABASE gechong;
    Query OK, 1 row affected (0.00 sec)
    
    mysql> CREATE TABLE test_oltp
        -> SELECT * FROM mysql.user;
    ERROR 1046 (3D000): No database selected
    mysql> USE gechong;
    Database changed
    mysql> CREATE TABLE test_oltp SELECT * FROM mysql.user;
    Query OK, 3 rows affected (0.01 sec)
    Records: 3  Duplicates: 0  Warnings: 0
    

      

    [root@10-4-5-9 ~]# sysbench --test=oltp --oltp-table-size=2000000 --oltp-table-name=test_oltp --mysql-db=gechong --mysql-user=root  --msyql-password=gechong prepare
    Unknown option: --msyql-password.
    

      

    提示创建失败了。

    查看下帮助

    sysbench [general-options]... --test=<test-name> [test-options] ... command

    General options:

    --num-threads=N number of threads to use [1]
    --max-requests=N limit for total number of requests [10000]
    --max-time=N limit for total execution time in seconds [0]
    --forced-shutdown=STRING amount of time to wait after --max-time before forcing shutdown [off]
    --thread-stack-size=SIZE size of stack per thread [32K]
    --init-rng=[on|off] initialize random number generator [off]
    --test=STRING test to run
    --debug=[on|off] print more debugging info [off]
    --validate=[on|off] perform validation checks where possible [off]
    --help=[on|off] print help and exit
    --version=[on|off] print version and exit

    Compiled-in tests:
    fileio - File I/O test
    cpu - CPU performance test
    memory - Memory functions speed test
    threads - Threads subsystem performance test
    mutex - Mutex performance test
    oltp - OLTP test

    command

    prepare/run/cleanup/help/version

    查看帮助

    [root@10-4-5-9 ~]# sysbench --help=on --test=<oltp> help
    

      

  • 相关阅读:
    p4841 城市规划
    p2619 [国家集训队2]Tree I [wqs二分学习]
    p3723 [AH2017/HNOI2017]礼物
    p5437 【XR-2】约定
    p5349 幂
    数据结构:结构之美
    你所不知道的传输层
    为什么选择这种技术而不选择另一种技术?
    Internet路由-主机路由表和转发表
    计算机网络----数据链路层(三)
  • 原文地址:https://www.cnblogs.com/xiaoit/p/3982875.html
Copyright © 2020-2023  润新知