性能測試
更新時間 2025-01-23 16:38:00
最近更新時間: 2025-01-23 16:38:00
分享文章
前提條件
已創建了文件系統,并已掛載至云主機。
說明
本文旨在指導性能測試方法,若要達到官網性能指標,建議使用多臺云服務器進行測試。性能指標參見產品規格。
注意事項
不同云主機規格帶寬限制不同,測試不同存儲規格的文件系統要注意選擇合適帶寬的云主機,否則無法達到官網性能指標。建議規格如下:
參數
建議規格 CPU >=16核 內存 >=32GB 最大帶寬 >=10Gbps 如果您所在資源池的云主機最大帶寬無法達到文件系統帶寬官網規格上限,需要開通多臺云主機,并將測得結果求和即為最終的結果。
操作步驟
以root 用戶登錄云主機。
安裝FIO測試工具。
Linux:
yum install fio -yWindows: 可從FIO官網下載,建議安裝到C盤,“C:\Program Files\ ”路徑下。
3. 根據要測試的性能指標運行相應測試命令。
fio參數說明
| 參數 | 參數說明 |
|---|---|
| -name | 測試名稱,用于在輸出結果中區分不同的測試任務。例如-name=test - read - write可以定義一個名為“test - read - write”的測試任務。 |
| -ioengine | I/O引擎,用于指定產生I/O操作的底層機制。如-ioengine=libaio(Linux異步I/O庫),不同的引擎會以不同的方式處理I/O請求,影響測試的效率和準確性。 |
| -rw | 讀寫模式,用于確定測試是進行讀操作、寫操作還是混合讀寫操作。例如-rw=randwrite表示隨機寫,-rw=randread表示隨機讀,-rw=read表示順序讀,-rw=write表示順序寫,-rw=rw表示混合讀寫。 |
| -bs | 塊大小,指定I/O操作的數據塊大小,單位可以是字節(如4096表示4KB)。例如-bs=4k表示數據塊大小為4KB,它會影響測試的性能表現,不同的應用場景通常有對應的合適塊大小。通常測試帶寬時設置為1M,測試時延和IOPS時設置為4k。 |
| -size | 測試文件大小,定義了測試所涉及的數據量大小。例如-size=1G表示測試文件大小為1GB,用于評估存儲設備在不同數據量下的性能。 |
| -numjobs | 作業數量,指定同時運行的I/O作業數量。例如-numjobs=4表示同時有4個I/O作業在運行,用于模擬多線程或多進程應用對存儲設備的并發I/O操作。 |
| -runtime | 運行時間,規定了測試的運行時長。例如-runtime=60表示測試將持續運行60秒,可用于在不同時間尺度下評估存儲設備的性能。 |
| -group_reporting | 分組報告,當有多個作業(由-numjobs參數指定)同時運行時,會將所有作業的性能結果匯總報告,方便查看整體性能。 |
| -directory | 測試文件所在目錄,用于指定測試文件存放的位置。例如-directory=/data/test_dir表示測試文件將在/data/test_dir目錄下進行操作,可針對特定存儲路徑進行性能評估。 |
| -rwmixwrite | 在混合讀寫(rw)模式下,指定寫操作所占的比例,范圍是0 - 100。例如-rwmixwrite=70表示在混合讀寫測試中,寫操作占總I/O操作的70%。 |
Linux性能測試
說明
性能測試命令中“-directory” 參數用于指定測試文件所在的目錄,如“- directory=/data/test_dir”表示測試文件將會在/data/test_dir這個目錄下生成并進行相關的 I/O 操作測試,請根據實際情況進行替換該目錄。
順序讀帶寬
fio -numjobs=10 -iodepth=32 -direct=1 -ioengine=libaio -sync=1 -rw=read -bs=1M -size=1G -time_based -runtime=60 -name=fio-bands -directory=/mnt/sfs/test_fio -rate=150M -ramp_time=10測試結果示例:
隨機讀帶寬
fio -numjobs=10 -iodepth=32 -direct=1 -ioengine=libaio -sync=1 -rw=randread -bs=1M -size=1G -time_based -runtime=60 -name=fio-bands -directory=/mnt/sfs/test_fio -rate=150M -ramp_time=10測試結果示例:
順序寫帶寬
fio -numjobs=10 -iodepth=32 -direct=1 -ioengine=libaio -sync=1 -rw=write -bs=1M -size=1G -time_based -runtime=60 -name=fio-bands -directory=/mnt/sfs/test_fio -rate=150M -ramp_time=10測試結果示例:
隨機寫帶寬
fio -numjobs=10 -iodepth=32 -direct=1 -ioengine=libaio -sync=1 -rw=randwrite -bs=1M -size=1G -time_based -runtime=60 -name=fio-bands -directory=/mnt/sfs/test_fio -rate=150M -ramp_time=10測試結果示例:
混合讀寫帶寬
fio -numjobs=10 -iodepth=32 -direct=1 -ioengine=libaio -sync=1 -rw=rw –rwmixwrite=30 -bs=1M -size=1G -time_based -runtime=60 -name=fio-bands -directory=/mnt/sfs/test_fio -rate=150M -ramp_time=10測試結果示例:
順序讀IOPS
fio -numjobs=10 -iodepth=32 -direct=1 -ioengine=libaio -sync=1 -rw=read -bs=4k -size=1G -time_based -runtime=60 -name=fio-iops -directory=/mnt/sfs/test_fio -rate_iops=500 -ramp_time=10
測試結果示例:
隨機讀IOPS
fio -numjobs=10 -iodepth=32 -direct=1 -ioengine=libaio -sync=1 -rw=randread -bs=4k -size=1G -time_based -runtime=60 -name=fio-iops -directory=/mnt/sfs/test_fio -rate_iops=500 -ramp_time=10測試結果示例:
順序寫IOPS
fio -numjobs=10 -iodepth=32 -direct=1 -ioengine=libaio -sync=1 -rw=write -bs=4k -size=1G -time_based -runtime=60 -name=fio-iops -directory=/mnt/sfs/test_fio -rate_iops=500 -ramp_time=10測試結果示例:
隨機寫IOPS
fio -numjobs=10 -iodepth=32 -direct=1 -ioengine=libaio -sync=1 -rw=randwrite -bs=4k -size=1G -time_based -runtime=60 -name=fio-iops -directory=/mnt/sfs/test_fio -rate_iops=500 -ramp_time=10測試結果示例:
順序讀時延
fio -numjobs=10 -iodepth=1 -direct=1 -ioengine=libaio -sync=1 -rw=read -bs=4k -size=1G -time_based -runtime=60 -name=fio-latency -directory=/mnt/sfs/test_fio -rate_iops=1010 -ramp_time=10測試結果示例:
隨機讀時延
fio -numjobs=10 -iodepth=1 -direct=1 -ioengine=libaio -sync=1 -rw=randread -bs=4k -size=1G -time_based -runtime=60 -name=fio-latency -directory=/mnt/sfs/test_fio -rate_iops=1010 -ramp_time=10
測試結果示例:
順序寫時延
fio -numjobs=10 -iodepth=1 -direct=1 -ioengine=libaio -sync=1 -rw=write -bs=4k -size=1G -time_based -runtime=60 -name=fio-latency -directory=/mnt/sfs/test_fio -rate_iops=1010 -ramp_time=10測試結果示例:
隨機寫時延
fio -numjobs=10 -iodepth=1 -direct=1 -ioengine=libaio -sync=1 -rw=randwrite -bs=4k -size=1G -time_based -runtime=60 -name=fio-latency -directory=/mnt/sfs/test_fio -rate_iops=1010 -ramp_time=10測試結果示例:
CIFS文件系統性能測試
說明
本文以將文件系統掛載到Z: 盤為例執行性能測試,請根據實際映射的盤符替換命令中的filename路徑。
隨機讀帶寬
.\fio.exe -numjobs=25 -iodepth=32 -direct=1 -ioengine=windowsaio -sync=1 -rw=randread -bs=1M -size=1G -thread -time_based -runtime=60 -name=fio-band -rate=150M -ramp_time=10 -filename="Z\:\targetfile"測試結果示例:
隨機寫帶寬
.\fio.exe -numjobs=25 -iodepth=32 -direct=1 -ioengine=windowsaio -sync=1 -rw=randwrite -bs=1M -size=1G -time_based -thread -runtime=60 -name=fio-band -rate=150M -ramp_time=10 -filename="Z\:\targetfile"測試結果示例:
隨機讀IOPS
.\fio.exe -numjobs=25 -iodepth=32 -direct=1 -ioengine=windowsaio -sync=1 -rw=randread -bs=4k -size=1G -time_based -thread -runtime=60 -name=fio-iops -rate_iops=500 -ramp_time=10 -filename="Z\:\targetfile"測試結果示例:
隨機寫IOPS
.\fio.exe -numjobs=25 -iodepth=32 -direct=1 -ioengine=windowsaio -sync=1 -rw=randwrite -bs=4k -size=1G -time_based -thread -runtime=60 -name=fio-iops -rate_iops=500 -ramp_time=10 -filename="Z\:\targetfile"測試結果示例: