我通过stress在脚本 shell 中使用该程序应用 cpu 压力测试来测试我的系统健康状况。这是脚本及其输出:
xubuntu@xubuntu:~$ cat bin/test_stress.sh
echo "=============== Starting stress test ===================="
uptime
sudo stress --cpu 4 --io 3 --timeout 2m &
while (true)
do
sleep 5
uptime
done
xubuntu@xubuntu:~$ bin/test_stress.sh
=============== Starting stress test ====================
21:52:37 up 25 min, 4 users, load average: 0.02, 0.20, 0.71
stress: info: [7384] dispatching hogs: 4 cpu, 3 io, 0 vm, 0 hdd
21:52:42 up 25 min, 4 users, load average: 0.34, 0.27, 0.73
21:52:47 up 25 min, 4 …Run Code Online (Sandbox Code Playgroud)