我该如何在 Ubuntu 上对 Intel Core i7-4790k 进行压力测试和监控温度?
答案1
我推荐stress-ng(因为我将它编写用于压力测试系统),它内置了广泛的压力测试。矩阵压力器是一个很好的入门工具,因为它可以测试CPU浮点、缓存和内存,例如:
stress-ng --matrix 0 -t 60s --tz
stress-ng: info: [10514] dispatching hogs: 4 matrix
stress-ng: info: [10514] cache allocate: default cache size: 3072K
stress-ng: info: [10514] successful run completed in 60.00s (1 min, 0.00 secs)
stress-ng: info: [10514] matrix:
stress-ng: info: [10514] acpitz 78.00 °C
stress-ng: info: [10514] x86_pkg_temp 78.25 °C
上述操作在所有 CPU 上运行矩阵压力器 60 秒,并转储 ACPI 热区和 CPU 封装温度的热区温度。
CPU 压力器还包含多种压力方法,例如,要在 2 个 CPU 上执行 30 秒的长时间双浮点运算来对 CPU 施加压力,请使用以下命令:
stress-ng --cpu 2 --cpu-method longdouble -t 30s --tz --metrics-brief
stress-ng: info: [10572] dispatching hogs: 2 cpu
stress-ng: info: [10572] cache allocate: default cache size: 3072K
stress-ng: info: [10572] successful run completed in 30.00s
stress-ng: info: [10572] stressor bogo ops real time usr time sys time bogo ops/s bogo ops/s
stress-ng: info: [10572] (secs) (secs) (secs) (real time) (usr+sys time)
stress-ng: info: [10572] cpu 71482 30.00 59.96 0.00 2382.65 1192.16
stress-ng: info: [10572] cpu:
stress-ng: info: [10572] acpitz 76.00 °C
stress-ng: info: [10572] x86_pkg_temp 76.50 °C
要查看所有 CPU 压力源方法,请使用:
stress-ng --cpu-method which
cpu-method must be one of: all ackermann bitops callfunc cdouble cfloat
clongdouble correlate crc16 decimal32 decimal64 decimal128 dither djb2a
double euler explog fft fibonacci float fnv1a gamma gcd gray hamming hanoi
hyperbolic idct int128 int64 int32 int16 int8 int128float int128double
int128longdouble int128decimal32 int128decimal64 int128decimal128
int64float int64double int64longdouble int32float int32double
int32longdouble jenkin jmp ln2 longdouble loop matrixprod nsqrt
omega parity phi pi pjw prime psi queens rand rand48 rgb sdbm sieve
sqrt trig union zeta
请参阅stress-ng的手册页;它有许多压力测试选项。另请参阅Stress-ng 项目页面。