Io

是否有可以以恆定吞吐量讀寫磁碟的工具?

  • October 4, 2021

我正在尋找一種能夠以恆定的目標吞吐量(例如 3Mb/s)讀寫數據的工具,而不是將 I/O 系統推到極限。然後,我打算在這種相當穩定的 I/O 活動發生時監控各種指標。我看過類似的工具stressfio但似乎它們更傾向於最大吞吐量。對於可以執行此類操作的工具的任何建議將不勝感激。謝謝。

我找到了似乎可以滿足我要求的--rate選項:fio

rate=int[,int][,int]

Cap the bandwidth used by this job. The number is in bytes/sec, the normal suffix
rules apply. Comma-separated values may be specified for reads, writes, and trims
as described in blocksize.

For example, using rate=1m,500k would limit reads to 1MiB/sec and writes to
500KiB/sec. Capping only reads or writes can be done with rate=,500k or
rate=500k, where the former will only limit writes (to 500KiB/sec) and the latter
will only limit reads.

https://fio.readthedocs.io/en/latest/fio_man.html#cmdoption-arg-rate

pv -L應該可以覆蓋。

引用自:https://unix.stackexchange.com/questions/671809