sysbench测试

版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/u012742966/article/details/78832717

sysbench测试(macbook mf389,树莓派3b,其32位系统为官方raspbian,64位系统为pi64(好用的非官方编译的64位版树莓派系统))
参考机器:宏碁 Aspire E5-571G-50DA,intel Core i5-5200U 4GRAM,机械硬盘
命令参考的
https://yq.aliyun.com/articles/236511

感言:单独看sysbench的结果来说,树莓派性能并不差,尤其是树莓派3b,使用64位系统的话,性价比还是不错的
但是,从实际运行角度开看,树莓派3b运行高cpu使用的性能和macbook mf389相比差大概20倍
一、

sysbench --num-threads=4 --test=cpu --cpu-max-prime=20000 run

(素数计算)

1.Macbook
CPU speed:
events per second: 1048.50

General statistics:
total time: 10.0029s
total number of events: 10490

Latency (ms):
min: 2.80
avg: 3.81
max: 23.52
95th percentile: 4.25
sum: 39995.82

Threads fairness:
events (avg/stddev): 2622.5000/7.09
execution time (avg/stddev): 9.9990/0.00

(参考intel Core i5-5200U: 10.2994s)

2.树莓派3b,32位系统
Maximum prime number checked in CPU test: 20000

Test execution summary:
total time: 185.4605s
total number of events: 10000
total time taken by event execution: 741.6715
per-request statistics:
min: 73.82ms
avg: 74.17ms
max: 127.03ms
approx. 95 percentile: 74.60ms

Threads fairness:
events (avg/stddev): 2500.0000/8.22
execution time (avg/stddev): 185.4179/0.01

3.树莓派3b,64位系统
Maximum prime number checked in CPU test: 20000

Test execution summary:
total time: 15.1814s
total number of events: 10000
total time taken by event execution: 60.7052
per-request statistics:
min: 3.05ms
avg: 6.07ms
max: 11.68ms
approx. 95 percentile: 6.22ms

Threads fairness:
events (avg/stddev): 2500.0000/2.92
execution time (avg/stddev): 15.1763/0.00

这个网址有几个版本树莓派的测试资料
https://www.element14.com/community/community/raspberry-pi/blog/2016/02/29/the-most-comprehensive-raspberry-pi-comparison-benchmark-ever

实测,超过4线程时,运行时间和4线程完全一样

虽然64位的结果很好看,但是可能并不能说明问题,因为64位本来就更适合大数处理

补充:上面是0.4版本的sysbench在树莓派3b在64位系统上的运行结果,1.0.11下,运算时间位10.0086s
二、线程测试

sysbench --test=threads --num-threads=64 --thread-yields=100 --thread-locks=2 run

1.Macbook
General statistics:
total time: 10.0124s
total number of events: 42045

Latency (ms):
min: 0.03
avg: 15.23
max: 38.26
95th percentile: 31.37
sum: 640431.39

Threads fairness:
events (avg/stddev): 656.9531/18.77
execution time (avg/stddev): 10.0067/0.00

2.树莓派3b,64位系统
Test execution summary:
total time: 7.4613s
total number of events: 10000
total time taken by event execution: 475.9817
per-request statistics:
min: 0.36ms
avg: 47.60ms
max: 454.16ms
approx. 95 percentile: 156.31ms

Threads fairness:
events (avg/stddev): 156.2500/15.82
execution time (avg/stddev): 7.4372/0.01

没想到这里树莓派比macbook还强?!
这里mac上total number of events: 44827
但是树莓派上total number of events: 10000
因为咱不懂,不知道什么情况
值得注意的是本mac的cpu inter Core i5 5257U是双核4线程
而树莓派3b是4核

作为参考,试了一下intel Core i5-5200U 的处理器(也是双核)
结果,它只需1.0399s即可完事儿,秒完事儿,total number of events: 10000

所以说我的macbook不知道哪里出问题了,或者是这个通过brew安装的sysbench版本不一样造成的(macbook上的sysbench版本为1.0.11,而通过apt-get装的都为0.4.12

根据sysbench官网https://github.com/akopytov/sysbench#linux
安装最新版sysbench(1.0.11),之后继续进行测试

3.树莓派3b,64位系统
General statistics:
total time: 10.0281s
total number of events: 15443

Latency (ms):
min: 0.35
avg: 41.49
max: 416.31
95th percentile: 134.90
sum: 640786.90

Threads fairness:
events (avg/stddev): 241.2969/17.35
execution time (avg/stddev): 10.0123/0.01

也就是说,线程性能树莓派和macbook相同,这么厉害?!

三、

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

1.macbook
Total operations: 131072 (1071847.96 per second)
1024.00 MiB transferred (8373.81 MiB/sec)
General statistics:
total time: 0.1205s
total number of events: 131072
Latency (ms):
min: 0.00
avg: 0.00
max: 0.58
95th percentile: 0.00
sum: 89.00
Threads fairness:
events (avg/stddev): 131072.0000/0.00
execution time (avg/stddev): 0.0890/0.00

树莓派以及内存为4G的参考机器:运行太慢,暂时未获得运行结果
升级后,获得数据:
2.树莓派3b,64位系统
General statistics:
total time: 0.8963s
total number of events: 131072

Latency (ms):
min: 0.01
avg: 0.01
max: 0.12
95th percentile: 0.01
sum: 738.04

Threads fairness:
events (avg/stddev): 131072.0000/0.00
execution time (avg/stddev): 0.7380/0.00

3.参考机器:0.3326s

四、

sysbench --num-threads=12 --max-requests=10000  --test=fileio --file-total-size=3G --file-test-mode=rndrw prepare
sysbench --num-threads=12 --max-requests=10000  --test=fileio --file-total-size=3G --file-test-mode=rndrw run
sysbench --num-threads=12 --max-requests=10000  --test=fileio --file-total-size=3G --file-test-mode=rndrw cleanup

1.macbook(ssd高速硬盘)
prepare:3221225472 bytes written in 11.68 seconds (262.96 MiB/sec).

run:
File operations:
reads/s: 11568.22
writes/s: 7699.30
fsyncs/s: 24662.43

Throughput:
read, MiB/s: 180.75
written, MiB/s: 120.30

General statistics:
total time: 0.5169s
total number of events: 22800

Latency (ms):
min: 0.00
avg: 0.24
max: 8.21
95th percentile: 2.03
sum: 5531.97

Threads fairness:
events (avg/stddev): 1900.0000/129.35
execution time (avg/stddev): 0.4610/0.00

2.树莓派3b 64位系统(16GTF卡,class10)
prepare:要加sudo,大概上一个大号的功夫后创建完毕
参考 另一台笔记本电脑(win10+WSL):时间大致相同,比树莓派时间大概短1/3左右
run:
Operations performed: 6014 Read, 4002 Write, 12804 Other = 22820 Total
Read 93.969Mb Written 62.531Mb Total transferred 156.5Mb (12.436Mb/sec)
795.89 Requests/sec executed

Test execution summary:
total time: 12.5847s
total number of events: 10016
total time taken by event execution: 61.0644
per-request statistics:
min: 0.02ms
avg: 6.10ms
max: 98.23ms
approx. 95 percentile: 19.00ms

Threads fairness:
events (avg/stddev): 834.6667/44.40
execution time (avg/stddev): 5.0887/0.21

参考 另一台笔记本电脑:那台电脑太慢,耗费了210s(运行时注意到win10的杀毒进程(Antimalware Service Executable)同时也在高速运转,运行停止后杀毒进程同时停止高速运转)

展开阅读全文

没有更多推荐了,返回首页