Debian From Scratch性能测试方案
一 测试目标与环境准备
二 CPU与内存性能测试
sysbench cpu --threads=$(nproc) --time=60 runsysbench memory --threads=$(nproc) --time=60 runstress --cpu $(nproc) --io 2 --vm 2 --vm-bytes 128M --timeout 60ssudo perf record -a -g -o perf.data sleep 30sudo perf report -g graphmpstat -P ALL 1、vmstat 1三 存储与文件系统性能测试
fio --name=seqwrite --ioengine=libaio --rw=write --bs=1M --size=1G --numjobs=1 --direct=1 --filename=/dev/sdX --runtime=60fio --name=seqread --ioengine=libaio --rw=read --bs=1M --size=1G --numjobs=1 --direct=1 --filename=/dev/sdX --runtime=60fio --name=randwrite --ioengine=libaio --rw=randwrite --bs=4k --size=1G --numjobs=1 --direct=1 --filename=/dev/sdX --runtime=60fio --name=randread --ioengine=libaio --rw=randread --bs=4k --size=1G --numjobs=1 --direct=1 --filename=/dev/sdX --runtime=60dd if=/dev/zero of=/mnt/testfile bs=1M count=1024 oflag=directdd if=/mnt/testfile of=/dev/null bs=1M count=1024 iflag=directiostat -x 1四 网络与应用层性能测试
iperf3 -siperf3 -c 192.0.2.10 -t 30 -P 4ab -n 10000 -c 200 http://localhost/wrk -t12 -c400 -d30s http://localhost:3000performance.now() 测量函数执行时间benchmark.js 对比代码片段性能五 构建与综合场景测试
time make -j$(nproc)vmstat 1/iostat -x 1记录)。time与系统监控可直观量化差异。