在CentOS Stream 8上進行性能測試,您可以使用一系列基準測試工具來評估系統的各個方面性能,包括CPU、內存、磁盤I/O和網絡性能。以下是具體步驟和推薦工具:
Super Pi:用于計算圓周率π,測量系統的單線程性能。
yum install bc
echo "scale=5000;4*a(1)" | bc -l -q &> super_pi.txt
sysbench:進行CPU和內存性能測試。
yum install sysbench
sysbench cpu --threads=4 --events=10000 --time=0 run
yum install gcc gcc-gfortran git clone https://github.com/jeffhammond/STREAM.git cd STREAM/make export OMP_NUM_THREADS=1 ./stream_c.exe
yum install fio
fio --ioengine=libaio --bs=4k --direct=1 --thread --time_based --rw=randread --filename=/home/randread.txt --runtime=60 --numjobs=1 --iodepth=1 --group_reporting --name=randread-dep1 --size=1G
fio --ioengine=libaio --bs=4k --direct=1 --thread --time_based --rw=read --filename=/home/read.txt --runtime=60 --numjobs=1 --iodepth=1 --group_reporting --name=randread-dep1 --size=1G
iperf3:測量TCP和UDP帶寬性能。
yum install iperf3
iperf3 -s
iperf3 -c <服務器IP>
netperf:網絡性能的測量工具,可以測試吞吐量、丟包率等。
yum install netperf
netperf -H <服務器IP> -t TCP_STREAM
wrk:基于libevent的高性能HTTP基準測試工具。
yum install wrk
wrk -t12 -c400 -d30s http://<服務器IP>/
在進行性能測試時,請確保在一個穩定的環境中進行,并在測試前對系統進行適當的準備和優化。測試結果的分析需要結合具體的測試目標和需求,例如,對于數據庫系統,可能更關注吞吐量和響應時間。