想知道自己的树莓派满载情况下是多少功率,于是在usb处接上电压电流计,然后在树莓派中跑sysbench
由这篇文章进行精简
准备
1.树莓派使用的是raspbian lite (buster版)镜像
2.树莓派已安装docker
拉取sysbench镜像
sudo docker pull ociotec/sysbench:arm32v7
开始运行sysbench进行压测
docker run ociotec/sysbench:arm32v7 sysbench --test=cpu --cpu-max-prime=10000 --num-threads=4 run
这里只测CPU,所以--test=cpu
,--cpu-max-prime=10000
用来选项指定最大的素数,具体参数可以根据CPU的性能来设置,默认为10000,--num-threads=4
指定线程数
其他参数参考下表
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
测试结果
使用树莓派3B+跑--cpu-max-prime=10000 --num-threads=4
,大概在40s左右,这期间CPU都是满载的,看USB电流电压记,最大电流大致在700mA,也就是说此时功率约在3.5w左右,算是很低的了,还是比较省电的了,空载在250mA左右,也就是不到1.5w