2019年1月27日日曜日

psをメモリ使用順でソートする。メモリを使っているプロセスを探す

メモリを食っているプロセスを探す方法。
psをメモリ使用順の降順でソートして先頭の20件を表示する。

[user1@server1 /tmp]$ ps aux --sort -rss | head -n 20
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
user1      27816  0.0  9.8 478200 100216 ?       Sl   Jan18   0:06 Passenger AppPreloader: /deploy/hoge-shop/current (forking...)
root     19319  0.0  1.3 666912 13332 ?        SNl  Jan01  33:40 Passenger core
root      5225  0.0  1.2 575880 12240 ?        Ssl   2018  28:26 /usr/bin/python -Es /usr/sbin/tuned -l -P
root       336  0.0  1.1  44308 11904 ?        Ss    2018   3:07 /usr/lib/systemd/systemd-journald
root      5261  0.0  0.7 269596  7956 ?        Ssl   2018  15:33 /usr/sbin/rsyslogd -n
polkitd   5212  0.0  0.7 538540  7748 ?        Ssl   2018   0:05 /usr/lib/polkit-1/polkitd --no-debug
nginx    19330  0.0  0.7 115224  7236 ?        S    Jan01   0:07 nginx: worker process
root     24746  0.0  0.6 113144  6760 ?        Ss    2018   0:00 nginx: master process /usr/sbin/nginx
root     19316  0.0  0.5 363308  5876 ?        SNsl Jan01   0:05 Passenger watchdog
root     28716  0.0  0.5 154612  5564 ?        Ss   12:12   0:00 sshd: user1 [priv]
root         1  0.0  0.5 193440  5196 ?        Ss    2018   3:09 /usr/lib/systemd/systemd --system --deserialize 22
postfix  28888  0.0  0.3  89740  4052 ?        S    12:16   0:00 pickup -l -t unix -u
user1     28726  0.0  0.2 154612  2528 ?        S    12:12   0:00 sshd: user1@pts/0
root      2551  0.0  0.2  46484  2288 ?        Ss    2018   0:00 /usr/lib/systemd/systemd-udevd
user1      28727  0.0  0.2 115440  2140 pts/0    Ss   12:12   0:00 -bash
root     23385  0.0  0.2 112816  2072 ?        Ss    2018   0:37 /usr/sbin/sshd -D
user1     29961  0.0  0.1 155464  1900 pts/0    R+   12:57   0:00 ps aux --sort -rss
root      5327  0.0  0.1 126312  1504 ?        Ss    2018   0:28 /usr/sbin/crond -n
root       463  0.0  0.1  26656  1400 ?        Ss    2018   1:37 /usr/lib/systemd/systemd-logind

0 件のコメント:

コメントを投稿