zoukankan      html  css  js  c++  java
  • 安装基准测试工具sysbench

    下载地址:

    http://pan.baidu.com/s/16KhJ4

    解包

    tar -zxvf sysbench-0.4.12.tar.gz

    进入源码文件夹

    cd sysbench-0.4.12
    执行autogen脚本
    ./autogen.sh
        
    如果autogen.sh报错:
    运行以下两行命令
    echo "export LC_ALL=C" >> /root/.bashrc
    source /root/.bashrc
    
    ./configure --prefix=/usr/sysbench/ 
    --with-mysql-includes=/server/mysql/include/ 
    --with-mysql-libs=/server/mysql/lib 
    --with-mysql
    
    cp /usr/bin/libtool /root/sysbench-0.4.12/libtool
    
    make && make install

    看一下,如果生成了文件 /usr/sysbench/bin/sysbench

    就ok了,尽情享用它...

    测试:
    1)测试CPU:

    sysbench --test=cpu --cpu-max-prime=2000 run


    2)测试线程:

    sysbench--test=threads --num-threads=20 --thread-yields=10 --thread-locks=4 run


    3)测试IO:--num-threads 开启的线程 --file-total-size 总的文件大小
    1,prepare阶段,生成需要的测试文件,完成后会在当前目录下生成很多小文件。

    sysbench --test=fileio --num-threads=16 --file-total-size=2G --file-test-mode=rndrw prepare 

    2,run阶段

    sysbench --test=fileio --num-threads=20 --file-total-size=2G --file-test-mode=rndrw run

    3,清理测试时生成的文件

    sysbench --test=fileio --num-threads=20 --file-total-size=2G --file-test-mode=rndrw cleanup

    4)测试内存:

    sysbench --test=memory --memory-block-size=8k --memory-total-size=1G run

    5)测试mutex:

    sysbench –test=mutex –num-threads=100 –mutex-num=1000 –mutex-locks=100000 –mutex-loops=10000 run

    6)测试OLTP:
    1,prepare阶段,生成需要的测试表

    sysbench --test=oltp --mysql-table-engine=innodb --mysql-host=127.0.0.1 --mysql-db=test --oltp-table-size=500000 --mysql-user=usert --mysql-password=passt prepare

    2,run阶段

    sysbench --num-threads=16 --test=oltp --mysql-table-engine=innodb --mysql-host=127.0.0.1 --mysql-db=test --oltp-table-size=500000 --mysql-user=usert --mysql-password=passt run

    3,清理测试时生成的测试表

    sysbench --num-threads=16 --test=oltp --mysql-table-engine=innodb --mysql-host=127.0.0.1 --mysql-db=test --oltp-table-size=500000 --mysql-user=usert --mysql-password=passt cleanup

    以上为几种比较典型的测试...

  • 相关阅读:
    jQuery瀑布流绝对定位布局(二)(延迟AJAX加载图片)
    jQuery图片上传裁剪插件imgAreaSelect(分析四) 上传服务器端
    jQuery表格的排序,
    jQuery图片上传裁剪插件imgAreaSelect(分析二) 同步显示图像位置信息
    jQuery图片上传裁剪插件imgAreaSelect(分析三) 如何获得选择域的图像信息
    JS Get URL param
    Dictionary 比List占用更多的内存
    修改金蝶采购订单的默认采购方式
    sqlserver 数据库操作记录 实现
    用Python模拟键盘输入
  • 原文地址:https://www.cnblogs.com/yjken/p/3944798.html
Copyright © 2011-2022 走看看