性能测试工具sysbench简介
作者:网络转载 发布时间:[ 2014/1/21 10:58:14 ] 推荐标签:性能测试 测试工具
性能测试工具sysbench简介
出处信息
sysbench是一款开源的多线程性能测试工具,可以执行CPU/内存/线程/IO/数据库等方面的性能测试。数据库目前支持MySQL/Oracle /PostgreSQL。本文只是简单演示一下几种测试的用法,后续准备利用sysbench来对MySQL进行一系列的测试。具体的一些参数设置,需要根据不同的测试要求来进行调整。
下载
http://sourceforge.net/projects/sysbench/
编译安装
默认支持MySQL,如果需要测试Oracle/PostgreSQL,则在configure时需要加上-with-oracle或者-with-pgsql参数
以下是引用片段:
./configure --prefix=/u01/sysbench
--with-mysql-includes=/opt/mysql/include/mysql
--with-mysql-libs=/opt/mysql/lib/mysql
make && make install
参数
以下是引用片段:
NinGoo:/u01/sysbench/bin>$sysbench
Missing required command argument.
Usage:
sysbench [general-options]... --test= [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
Commands: prepare run cleanup help version
See ’sysbench --test= help’ for a list of options for each test.
CPU测试
sysbench采用寻找大素数的方式来测试CPU的性能
以下是引用片段:
NinGoo:/u01/sysbench/bin>$sysbench --test=cpu --cpu-max-prime=2000 run
sysbench 0.4.12: multi-threaded system evaluation benchmark
Running the test with following options:
Number of threads: 1
Doing CPU performance benchmark
Threads started!
Done.
Maximum prime number checked in CPU test: 2000
Test execution summary:
total time: 2.3996s
total number of events: 10000
total time taken by event execution: 2.3917
per-request statistics:
min: 0.23ms
avg: 0.24ms
max: 27.44ms
approx. 95 percentile: 0.24ms
Threads fairness:
events (avg/stddev): 10000.0000/0.00
execution time (avg/stddev): 2.3917/0.00
相关推荐
更新发布
功能测试和接口测试的区别
2023/3/23 14:23:39如何写好测试用例文档
2023/3/22 16:17:39常用的选择回归测试的方式有哪些?
2022/6/14 16:14:27测试流程中需要重点把关几个过程?
2021/10/18 15:37:44性能测试的七种方法
2021/9/17 15:19:29全链路压测优化思路
2021/9/14 15:42:25性能测试流程浅谈
2021/5/28 17:25:47常见的APP性能测试指标
2021/5/8 17:01:11