How to measure IOPS for a command in linux?

后端 未结 3 1674
盖世英雄少女心
盖世英雄少女心 2021-02-20 05:07

I\'m working on a simulation model, where I want to determine when the storage IOPS capacity becomes a bottleneck (e.g. and HDD has ~150 IOPS, while an SSD can have 150,000). So

3条回答
  •  半阙折子戏
    2021-02-20 05:47

    You can use pidstat:
    pidstat -d 2
    More specifically pidstat -d 2 | grep COMMAND or pidstat -C COMMANDNAME -d 2

    The pidstat command is used for monitoring individual tasks currently being managed by the Linux kernel. It writes to standard output activities for every task selected with option -p or for every task managed by the Linux kernel if option -p ALL has been used. Not selecting any tasks is equivalent to specifying -p ALL but only active tasks (tasks with non-zero statistics values) will appear in the report. The pidstat command can also be used for monitoring the child processes of selected tasks.

    -C commDisplay only tasks whose command name includes the stringcomm. This string can be a regular expression.

提交回复
热议问题