手机版
你好,游客 登录 注册 搜索
背景:
阅读新闻

SysBench - 一种系统性能Benchmark

[日期:2013-07-28] 来源:Linux社区  作者:younger_china [字体:大 中 小]

2. CPU性能测试

Sysbench采用寻找最大素数的方式测试CPU性能:

[root@RedHat ~]# sysbench --test=cpu help

sysbench v0.4.8: multi-threaded system evaluation benchmark

 

cpu options:

--cpu-max-prime=N upper limit for primes generator [10000]

 

[root@RedHat ~]#

参数解析

参数名

描述

--cpu-max-prime=N

素数的最大限制,默认为10000;

测试案例

[root@RedHat ~]# sysbench --test=cpu --cpu-max-prime=20000 run

sysbench v0.4.8: 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: 20000

Test execution summary:

total time: 124.1761s

total number of events: 10000

total time taken by event execution: 123.3658

per-request statistics:

min: 0.0051s

avg: 0.0123s

max: 0.1908s

approx. 95 percentile: 0.0171s

 

Threads fairness:

events (avg/stddev): 10000.0000/0.00

execution time (avg/stddev): 123.3658/0.00

[root@RedHat ~]#

 

3.内存性能测试

 

[root@RedHat ~]# sysbench --test=memory help

sysbench v0.4.8: multi-threaded system evaluation benchmark

 

memory options:

--memory-block-size=SIZE size of memory block for test [1K]

--memory-total-size=SIZE total size of data to transfer [100G]

--memory-scope=STRING memory access scope {global,local} [global]

--memory-hugetlb=[on|off] allocate memory from HugeTLB pool [off]

--memory-oper=STRING type of memory operations {read, write, none} [write]

--memory-access-mode=STRING memory access mode {seq,rnd} [seq]

 

[root@RedHat ~]#

 

参数名

描述

--memory-block-size=SIZE

内存块大小,默认为1K

--memory-total-size=SIZE

传输的数据量,默认为100G

--memory-scope=STRING

内存访问是局部local还是全局global,默认为global

--memory-hugetlb=[on|off]

从hugetlb中分配内存

--memory-oper=STRING

内存操作类型read, write, none,默认为写

--memory-access-mode=STRING

内存访问模式seq,rnd,默认为seq;

 

[root@RedHat test]# sysbench --test=memory --memory-block-size=4k --memory-total-size=64M run

 

 

4.线程性能测试

 

[root@RedHat ~]# sysbench --test=threads help

sysbench v0.4.8: multi-threaded system evaluation benchmark

 

threads options:

--thread-yields=N number of yields to do per request [1000]

--thread-locks=N number of locks per thread [8]

 

[root@RedHat ~]#

 

参数名

描述

--thread-yields=N

内存块大小,默认为1K

--thread-locks=N

传输的数据量,默认为100G

测试案例

[root@RedHat test]# sysbench --test=threads --num-threads=64 --thread-yields=100 --thread-locks=2 run

sysbench v0.4.8: multi-threaded system evaluation benchmark

 

Running the test with following options:

Number of threads: 64

 

Doing thread subsystem performance test

Thread yields per test: 100 Locks used: 2

Threads started!

Done.

 

Test execution summary:

total time: 24.8159s

total number of events: 10000

total time taken by event execution: 1575.5529

per-request statistics:

min: 0.0002s

avg: 0.1576s

max: 2.0173s

approx. 95 percentile: 0.5627s

 

Threads fairness:

events (avg/stddev): 156.2500/12.62

execution time (avg/stddev): 24.6180/0.08

 

[root@RedHat test]#

 

5互斥体性能测试

 

[root@RedHat ~]# sysbench --test=mutex help

sysbench v0.4.8: multi-threaded system evaluation benchmark

 

mutex options:

--mutex-num=N total size of mutex array [4096]

--mutex-locks=N number of mutex locks to do per thread [50000]

--mutex-loops=N number of empty loops to do inside mutex lock [10000]

 

[root@RedHat ~]#

 

参数名

描述

--mutex-num=N

互斥体数据大小,默认为4096

--mutex-locks=N

每个线程上互斥锁的数目,默认为50000;

--mutex-loops=N

互斥锁内空循环的数目,默认为10000

 

测试案例

[root@RedHat test]# sysbench --test=mutex --num-threads=16 --mutex-num=1024 --mutex-locks=10000 --mutex-loops=5000 run

sysbench v0.4.8: multi-threaded system evaluation benchmark

 

Running the test with following options:

Number of threads: 16

 

Doing mutex performance test

Threads started!

Done.

 

Test execution summary:

total time: 0.0482s

total number of events: 16

total time taken by event execution: 0.2271

per-request statistics:

min: 0.0015s

avg: 0.0142s

max: 0.0312s

approx. 95 percentile: 0.0126s

 

Threads fairness:

events (avg/stddev): 1.0000/0.00

execution time (avg/stddev): 0.0142/0.01

[root@RedHat test]#

 

6 OLTP测试

不做分析了

linux
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款