ioniceでio優先度をコントロールしてコマンドを実行してみる
ioniceの引数はこんな感じ(manより)
OPTIONS -c The scheduling class. 1 for real time, 2 for best-effort, 3 for idle. -n The scheduling class data. This defines the class data, if the class accepts an argument. For real time and best-effort, 0-7 is valid data. -p Pass in a process pid to change an already running process. If this argument is not given, ionice will run the listed pro- gram with the given parameters.
ioをアイドル時に行い、優先度最低の7でls -laを実行した例。
実際はrsyncとかcpとかをサービスに影響しないように実行したい時に使ったりする。
# ionice -c3 -n7 ls -la