Debian虚拟机性能测试可从CPU、内存、磁盘、网络等维度进行,常用工具及方法如下:
sysbench cpu --cpu-max-prime=20000 run
,测试单核/多核计算能力。stress-ng --cpu 4 --timeout 60s
,模拟多核CPU高负载。sysbench memory --memory-block-size=1M --memory-total-size=10G run
测试内存读写速度。memtester 1024 5
,检测内存稳定性。fio --name=random-write --rw=randwrite --bs=4k --size=1G --runtime=60
测试随机写入性能。dd if=/dev/zero of=testfile bs=1G count=1 oflag=direct
测试顺序写入速度。iperf3 -s
,客户端用iperf3 -c <服务器IP>
测试带宽。netserver
,客户端执行netperf -H <服务器IP> -t TCP_STREAM
。./Run
生成CPU、内存等综合评分。phoronix-test-suite benchmark
进行多维度测试。注意事项:测试前备份数据,从低负载开始逐步加压,避免影响系统稳定性。