有没有一种工具可以以恒定的吞吐量读取和写入磁盘?

有没有一种工具可以以恒定的吞吐量读取和写入磁盘?

我正在寻找一种能够以恒定目标吞吐量(例如 3Mb/s)读写数据的工具,而不是将 I/O 系统推向极限。然后,我打算在发生这种相当稳定的 I/O 活动的同时监控各种指标。我看过类似stress和 之类的工具fio,但似乎它们更适合最大吞吐量。任何有关可以执行此类操作的工具的建议将不胜感激。谢谢。

答案1

pv -L应该可以覆盖。

答案2

我找到了似乎可以做我想做的事情的--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

相关内容