VPS性能測試腳本
1. CPU性能測試
使用工具:sysbench
安裝sysbench sudo aptget install sysbench 執(zhí)行CPU性能測試 sysbench test=cpu cpumaxprime=20000 run
2. 內(nèi)存性能測試
使用工具:sysbench
執(zhí)行內(nèi)存性能測試 sysbench test=memory run
3. 磁盤I/O性能測試
使用工具:fio
安裝fio sudo aptget install fio 創(chuàng)建測試文件 dd if=/dev/urandom of=testfile bs=1G count=1 執(zhí)行磁盤I/O性能測試 fio name=testfile rw=randread bs=4k direct=1 numjobs=1 size=1G runtime=60 groupreporting=1
4. 網(wǎng)絡(luò)性能測試
使用工具:iperf3
4.1 服務(wù)器端
在VPS上安裝iperf3并設(shè)置為服務(wù)器端:
安裝iperf3 sudo aptget install iperf3 設(shè)置服務(wù)器端 iperf3 s
4.2 客戶端
在本地計算機(jī)上安裝iperf3并連接到VPS進(jìn)行測試:
安裝iperf3 sudo aptget install iperf3 連接到VPS進(jìn)行測試 iperf3 c <VPS_IP>
5. 回程測試
使用工具:traceroute
安裝traceroute sudo aptget install traceroute 執(zhí)行回程測試 traceroute <本地計算機(jī)IP>