ionice

最後更新: 2017-05-20

介紹

ionice 是在 util-linux Package 內的

Version:

ionice -V

ionice from util-linux 2.20.1

Help:

ionice -h

 


查看某 Proccess 的 ionice 值

 

<1> ionice -p <pid>

webpy:~# echo $$

4874

webpy:~# ionice -p 4874

# 如果沒有用 ionice 修改過, 那 Default (unknow 相當於 best-effort)

unknown: prio 4

best-effort:

best-effort: prio 4

ilde:

idle

<2> iotop

 


Usage

 

ionice [-c class] [-n level] [-t] -p PID

ionice [-c class] [-n level] [-t] command [argument...]

scheduling classes (-c)

- Idle (3)                   # only get disk time when no other program has asked for disk I/O for a defined grace period.

- Best-effort (2)

- Realtime (1)            # 只有 root 才用到; given first access to the disk

- none (0)

classdata level ( 只有 realtime, best-effort 用到 )(-n):

For realtime and best-effort,

0(highest) ~ 7 are valid data (priority levels)

NOTES

Linux supports I/O scheduling priorities and classes since 2.6.13 with the CFQ I/O scheduler.

cat /sys/block/<Device_Name>/queue/scheduler

noop deadline [cfq]

Example

# PID 89 as an idle I/O process.

ionice -c 3 -p 89

# Runs 'bash' as a best-effort program with highest priority.

ionice -c 2 -n 0 bash

 

Creative Commons license icon Creative Commons license icon