#1 案板上的鹹魚🐟
#!/bin/bash
# 运行 CPU 压力测试
echo "Running CPU stress test..."
stress-ng --cpu 2 --timeout 60s
# 运行内存压力测试
echo "Running memory stress test..."
stress-ng --vm 2 --vm-bytes 128M --timeout 60s
# 运行磁盘 I/O 测试
echo "Running disk I/O test..."
fio --name=test --ioengine=libaio --direct=1 --rw=randrw --bs=4k --size=1G --numjobs=1 --runtime=60 --time_based --group_reporting
# 运行网络带宽测试
echo "Running network bandwidth test..."
iperf3 -s &
sleep 5
iperf3 -c localhost -t 60
# 清理
pkill iperf3
echo "All tests completed."