topコマンド 虎の巻
top - 13:14:41 up 1:39, 2 users, load average: 0.01, 0.01, 0.00 Tasks: 110 total, 1 running, 109 sleeping, 0 stopped, 0 zombie %Cpu(s): 0.0 us, 0.0 sy, 0.0 ni, 99.8 id, 0.2 wa, 0.0 hi, 0.0 si, 0.0 st MiB Mem : 981.1 total, 150.2 free, 160.2 used, 670.7 buff/cache MiB Swap: 0.0 total, 0.0 free, 0.0 used. 652.3 avail Mem PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 33061 redis 20 0 51224 4788 3480 S 0.3 0.5 0:15.80 redis-server 62879 root 20 0 0 0 0 I 0.3 0.0 0:01.22 kworker/1:0-events 1 root 20 0 168888 12816 8272 S 0.0 1.3 0:31.60 systemd 2 root 20 0 0 0 0 S 0.0 0.0 0:00.01 kthreadd 3 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 rcu_gp
1を押す:CPUコア毎に表示
top - 13:15:35 up 1:40, 2 users, load average: 0.00, 0.00, 0.00 Tasks: 110 total, 1 running, 109 sleeping, 0 stopped, 0 zombie %Cpu0 : 0.3 us, 0.3 sy, 0.0 ni, 99.3 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st %Cpu1 : 0.0 us, 0.0 sy, 0.0 ni,100.0 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st MiB Mem : 981.1 total, 150.2 free, 160.2 used, 670.7 buff/cache MiB Swap: 0.0 total, 0.0 free, 0.0 used. 652.3 avail Mem PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 468 root rt 0 345864 18260 8288 S 0.3 1.8 0:08.44 multipathd 33061 redis 20 0 51224 4788 3480 S 0.3 0.5 0:15.96 redis-server 63964 root 20 0 0 0 0 I 0.3 0.0 0:00.44 kworker/0:2-events 1 root 20 0 168888 12816 8272 S 0.0 1.3 0:31.60 systemd
Shift+p:CPU使用率順にソート
Tasks: 110 total, 1 running, 109 sleeping, 0 stopped, 0 zombie %Cpu0 : 0.0 us, 0.0 sy, 0.0 ni,100.0 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st %Cpu1 : 0.0 us, 0.3 sy, 0.0 ni, 99.7 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st MiB Mem : 981.1 total, 149.9 free, 160.3 used, 670.8 buff/cache MiB Swap: 0.0 total, 0.0 free, 0.0 used. 652.2 avail Mem PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 15383 root 19 -1 59728 16720 15644 S 0.3 1.7 0:05.04 systemd-journal 33061 redis 20 0 51224 4788 3480 S 0.3 0.5 0:16.10 redis-server 1 root 20 0 168888 12816 8272 S 0.0 1.3 0:31.61 systemd 2 root 20 0 0 0 0 S 0.0 0.0 0:00.01 kthreadd 3 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 rcu_gp
Shift+m:メモリ使用率順にソート
top - 13:17:10 up 1:41, 2 users, load average: 0.00, 0.00, 0.00 Tasks: 110 total, 1 running, 109 sleeping, 0 stopped, 0 zombie %Cpu0 : 0.0 us, 0.3 sy, 0.0 ni, 99.7 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st %Cpu1 : 0.3 us, 0.0 sy, 0.0 ni, 99.3 id, 0.0 wa, 0.0 hi, 0.3 si, 0.0 st MiB Mem : 981.1 total, 149.7 free, 160.5 used, 670.9 buff/cache MiB Swap: 0.0 total, 0.0 free, 0.0 used. 652.1 avail Mem PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 468 root rt 0 345864 18260 8288 S 0.0 1.8 0:08.55 multipathd 8390 root 20 0 30160 18136 9472 S 0.0 1.8 0:00.23 networkd-dispat 15609 root 20 0 944096 17540 3580 S 0.0 1.7 0:01.40 snapd 15383 root 19 -1 59728 16748 15672 S 0.0 1.7 0:05.06 systemd-journa
fを押す:画面が切り替わるので、矢印キーで選択してスペースでトグルできる。ESCで戻る
Fields Management for window 1:Def, whose current sort field is %MEM Navigate with Up/Dn, Right selects for move then <Enter> or Left commits, 'd' or <Space> toggles display, 's' sets sort. Use 'q' or <Esc> to end! * PID = Process Id UID = Effective User Id TIME = CPU Time OOMa = OOMEM Adjustment RSan = RES Anonymous (KiB) * USER = Effective User Name RUID = Real User Id SWAP = Swapped Size (KiB) OOMs = OOMEM Score current RSfd = RES File-based (KiB) * PR = Priority RUSER = Real User Name CODE = Code Size (KiB) ENVIRON = Environment vars RSlk = RES Locked (KiB) * NI = Nice Value SUID = Saved User Id DATA = Data+Stack (KiB) vMj = Major Faults delta RSsh = RES Shared (KiB) * VIRT = Virtual Image (KiB) SUSER = Saved User Name nMaj = Major Page Faults vMn = Minor Faults delta CGNAME = Control Group name * RES = Resident Size (KiB) GID = Group Id nMin = Minor Page Faults USED = Res+Swap Size (KiB) NU = Last Used NUMA node * SHR = Shared Memory (KiB) GROUP = Group Name nDRT = Dirty Pages Count nsIPC = IPC namespace Inode * S = Process Status PGRP = Process Group Id WCHAN = Sleeping in Function nsMNT = MNT namespace Inode * %CPU = CPU Usage TTY = Controlling Tty Flags = Task Flags <sched.h> nsNET = NET namespace Inode * %MEM = Memory Usage (RES) TPGID = Tty Process Grp Id CGROUPS = Control Groups nsPID = PID namespace Inode * TIME+ = CPU Time, hundredths SID = Session Id SUPGIDS = Supp Groups IDs nsUSER = USER namespace Inode * COMMAND = Command Name/Line nTH = Number of Threads SUPGRPS = Supp Groups Names nsUTS = UTS namespace Inode PPID = Parent Process pid P = Last Used Cpu (SMP) TGID = Thread Group Id LXC = LXC