ablog

不器用で落着きのない技術者のメモ

ps auxw したときに STAT 列に表示される値の意味

STAT列 何の略? カーネル内部のプロセスの状態 説明
R Run TASK_RUNNING 実行可能な状態。CPUが空きさえすれば、いつでも実行可能な状態。
S Sleep TASK_INTERRUPTIBLE 割り込み可能な待ち状態。おもに復帰時間が予測不能な長時間の待ち状態。スリープやユーザからの入力待ちなど。
D Disk Sleep TASK_UNINTERRUPTIBLE 割り込み不可能な待ち状態。おもに短時間で復帰する場合の待ち状態。ディスクの入出力待ち。
T Stopped TASK_STOPPED サスペンドシグナルを送られて実行中断になった状態。リジュームされるまでスケジューリングされない。
Z Zombie TASK_ZOMBIE ゾンビ状態。子プロセスが exit して親プロセスにリープされるまでの状態。


ps のマニュアルを見てみると、

$ cat /etc/issue
Red Hat Enterprise Linux Server release 5.3 (Tikanga)
Kernel \r on an \m

$ uname -r
2.6.18-128.el5

$ man ps
...
PROCESS STATE CODES
Here are the different values that the s, stat and state output specifiers (header "STAT" or "S") will display to describe the state of a
process.
D    Uninterruptible sleep (usually IO)
R    Running or runnable (on run queue)
S    Interruptible sleep (waiting for an event to complete)
T    Stopped, either by a job control signal or because it is being traced.
W    paging (not valid since the 2.6.xx kernel)
X    dead (should never be seen)
Z    Defunct ("zombie") process, terminated but not reaped by its parent.

For BSD formats and when the stat keyword is used, additional characters may be displayed:
<    high-priority (not nice to other users)
N    low-priority (nice to other users)
L    has pages locked into memory (for real-time and custom IO)
s    is a session leader
l    is multi-threaded (using CLONE_THREAD, like NPTL pthreads do)
+    is in the foreground process group

参考

[24時間365日] サーバ/インフラを支える技術 ?スケーラビリティ、ハイパフォーマンス、省力運用 (WEB+DB PRESS plusシリーズ)

[24時間365日] サーバ/インフラを支える技術 ?スケーラビリティ、ハイパフォーマンス、省力運用 (WEB+DB PRESS plusシリーズ)

P.155 表4.1.1 プロセスディスクリプタの状態の区別
P.160 column プロセスの状態をツールで見る ……ps