FIO 是一個 benchmark 工具,可以計算硬碟速度、以及 IO
隨機寫入測試
fio --name fio_test_write --direct=1 --rw=randwrite --bs=4k --size=1G --numjobs=16 --runtime=180 --group_reporting --refill_buffers --ioengine=libaio --iodepth=16
隨機讀取測試
fio --name fio_test_read --direct=1 --rw=randread --bs=4k --size=1G --numjobs=16 --runtime=180 --group_reporting --refill_buffers --ioengine=libaio --iodepth=16
fio 參數說明
--direct=1 # non-buffered I/O
--rw=randrw # 隨機寫與讀
# read
# write
# rw
# randread
# randwrite
# randrw
--bs=4k # block size 檔案寫入大小
--size=4g # 測試的大小
--numjobs=16 # 同一個 workload 同時多少個 IO 請求
--runtime=180 # timeout 時間 (秒),就算 --size 的大小還未到達,還是結束
--ioengine=libaio # IO 引擎
# libaio - async IO
# ...
--rwmixwrite=30 # 混合讀寫時,寫佔 30% loading
--rwmixread=100 # 混合讀寫時,讀佔 100% loading
--refill_buffers # 把 Buffer 填滿就不會跑到 Buffer 的值
--group_reporting # 總表顯示
--iodepth=16 # 同一時間有多少 IO 在作存取
--name=fio_test_write # job 名稱,會在當下目錄產生暫存檔
留言