1. Top Command
top – 10:57:46 up 3 min, 2 users, load average: 1.24, 0.86, 0.35
Tasks: 66 total, 3 running, 63 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.0%us, 0.3%sy, 0.0%ni, 99.0%id, 0.7%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 1032044k total, 565316k used, 466728k free, 13536k buffers
Swap: 2128604k total, 0k used, 2128604k free, 238368k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
5523 root 15 0 98584 31m 14m S 0.3 3.1 0:00.97 SVRServer
1 root 15 0 1648 536 468 S 0.0 0.1 0:00.50 init
2 root RT -5 0 0 0 S 0.0 0.0 0:00.00 migration/0
3 root 15 0 0 0 0 S 0.0 0.0 0:00.00 ksoftirqd/0
4 root RT -5 0 0 0 S 0.0 0.0 0:00.00 watchdog/0
5 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 events/0
6 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 khelper
7 root 11 -5 0 0 0 S 0.0 0.0 0:00.00 kthread
8 root RT -5 0 0 0 D 0.0 0.0 0:00.00 kmem_kthread
11 root 10 -5 0 0 0 S 0.0 0.0 0:00.04 kblockd/0
12 root 20 -5 0 0 0 S 0.0 0.0 0:00.00 kacpid
176 root 19 -5 0 0 0 S 0.0 0.0 0:00.00 cqueue/0
179 root 19 -5 0 0 0 S 0.0 0.0 0:00.00 khubd
181 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 kseriod
244 root 24 0 0 0 0 S 0.0 0.0 0:00.00 pdflush
245 root 15 0 0 0 0 S 0.0 0.0 0:00.02 pdflush
2. mpstat Command to display each CPU individually utilization
# mpstat
Linux 2.6.18-92cp (CP-FW-1) 05/08/13
10:36:06 CPU %user %nice %sys %iowait %irq %soft %steal %idle intr/s
10:36:06 all 8.03 0.00 1.35 0.27 0.03 0.18 0.00 90.14 526.71
# mpstat -P ALL
Linux 2.6.18-92cp (CP-FW-1) 05/08/13
10:36:47 CPU %user %nice %sys %iowait %irq %soft %steal %idle intr/s
10:36:47 all 8.03 0.00 1.35 0.27 0.03 0.18 0.00 90.14 526.71
10:36:47 0 7.72 0.00 1.36 0.27 0.03 0.20 0.00 90.42 272.65
10:36:47 1 8.35 0.00 1.35 0.27 0.02 0.16 0.00 89.85 254.06
3. sar Command to display today’s CPU activity
# sar
Linux 2.6.18-92cp (CP-FW-1) 05/08/13
00:00:01 CPU %user %nice %system %iowait %steal %idle
00:10:01 all 8.42 0.00 1.65 0.29 0.00 89.64
00:20:01 all 8.47 0.00 1.62 0.33 0.00 89.57
00:30:01 all 10.95 0.00 1.61 0.28 0.00 87.16
00:40:01 all 8.42 0.00 1.64 0.30 0.00 89.64
00:50:01 all 8.43 0.00 1.66 0.26 0.00 89.66
01:00:01 all 8.44 0.00 1.60 0.26 0.00 89.70
01:10:02 all 8.43 0.00 1.67 0.33 0.00 89.57
01:20:01 all 8.44 0.00 1.66 0.25 0.00 89.65
01:30:01 all 10.86 0.00 1.69 0.31 0.00 87.14
01:40:01 all 8.41 0.00 1.63 0.33 0.00 89.62
01:50:01 all 8.41 0.00 1.60 0.29 0.00 89.70
02:00:01 all 8.40 0.00 1.59 0.27 0.00 89.75
02:10:01 all 8.40 0.00 1.64 0.30 0.00 89.67
02:20:01 all 8.40 0.00 1.58 0.28 0.00 89.74
02:30:01 all 10.86 0.00 1.63 0.25 0.00 87.26
02:40:01 all 8.41 0.00 1.62 0.24 0.00 89.73
02:50:01 all 8.41 0.00 1.64 0.34 0.00 89.61
03:00:01 all 8.40 0.00 1.59 0.29 0.00 89.71
03:10:01 all 8.42 0.00 1.60 0.29 0.00 89.68
03:20:01 all 8.41 0.00 1.58 0.31 0.00 89.69
03:30:01 all 10.9 0.00 1.64 0.31 0.00 87.11
03:40:01 all 8.42 0.00 1.62 0.24 0.00 89.72
03:50:01 all 8.42 0.00 1.60 0.36 0.00 89.62
04:00:01 all 8.39 0.00 1.60 0.29 0.00 89.72
04:10:01 all 8.40 0.00 1.62 0.26 0.00 89.72
04:20:01 all 8.40 0.00 1.60 0.30 0.00 89.70
04:30:01 all 10.90 0.00 1.73 0.30 0.00 87.07
04:40:01 all 8.43 0.00 1.67 0.27 0.00 89.63
04:50:01 all 8.43 0.00 1.67 0.28 0.00 89.62
05:00:01 all 8.45 0.00 1.94 0.31 0.00 89.29
05:10:01 all 8.55 0.00 1.99 0.32 0.00 89.15
05:20:02 all 8.47 0.00 1.94 0.30 0.00 89.29
05:30:01 all 10.91 0.00 1.74 0.27 0.00 87.09
05:40:01 all 8.49 0.00 2.19 0.27 0.00 89.05
05:50:01 all 8.43 0.00 1.64 0.26 0.00 89.68
06:00:01 all 8.41 0.00 1.71 0.29 0.00 89.58
06:10:01 all 8.43 0.00 1.61 0.27 0.00 89.69
06:20:01 all 8.41 0.00 1.61 0.28 0.00 89.70
06:30:01 all 10.92 0.00 1.65 0.36 0.00 87.08
06:40:01 all 8.53 0.00 2.00 0.30 0.00 89.16
06:50:01 all 8.42 0.00 1.71 0.33 0.00 89.55
07:00:01 all 8.43 0.00 1.59 0.27 0.00 89.71
07:10:01 all 8.44 0.00 1.60 0.28 0.00 89.69
07:20:01 all 8.42 0.00 1.63 0.27 0.00 89.68
07:30:01 all 10.84 0.00 1.61 0.31 0.00 87.24
07:40:01 all 8.44 0.00 1.61 0.27 0.00 89.69
07:50:01 all 8.45 0.00 1.63 0.27 0.00 89.66
08:00:01 all 8.46 0.00 1.65 0.25 0.00 89.64
08:10:01 all 8.41 0.00 1.60 0.29 0.00 89.70
08:20:01 all 8.39 0.00 1.60 0.30 0.00 89.71
08:30:01 all 10.88 0.00 1.61 0.29 0.00 87.22
08:40:01 all 8.42 0.00 1.65 0.27 0.00 89.66
08:50:01 all 8.42 0.00 1.59 0.28 0.00 89.71
09:00:01 all 8.41 0.00 1.60 0.25 0.00 89.73
09:10:01 all 8.43 0.00 1.60 0.30 0.00 89.67
09:20:01 all 8.41 0.00 1.64 0.29 0.00 89.66
09:30:02 all 10.86 0.00 1.62 0.25 0.00 87.27
09:40:01 all 8.50 0.00 1.61 0.32 0.00 89.58
09:50:01 all 8.44 0.00 1.59 0.33 0.00 89.63
10:00:01 all 8.41 0.00 1.63 0.28 0.00 89.68
10:10:01 all 8.39 0.00 1.60 0.33 0.00 89.67
10:20:01 all 8.42 0.00 1.58 0.28 0.00 89.72
10:30:01 all 10.87 0.00 1.63 0.37 0.00 87.13
Average: all 8.86 0.00 1.66 0.29 0.00 89.19
sar -u 2 5 to display comparison of CPU utilization; 2 seconds apart; 5 times,
4. PS command to find out who is monopolizing or eating the CPUs
5. iostat command to report CPU statistics and input/output statistics for devices and partitions since last reboot.
# iostat
Linux 2.6.18-92cp (CP-FW-1) 05/08/13
avg-cpu: %user %nice %system %iowait %steal %idle
8.03 0.00 1.56 0.27 0.00 90.14
Device: tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn
sda 23.67 0.10 203.59 1382468 2879161118
dm-0 15.87 0.05 126.96 681826 1795461872
dm-1 47.55 0.05 76.63 694258 1083698632
dm-2 0.00 0.00 0.00 392 0
dm-3 0.00 0.00 0.00 392 0
dm-4 0.00 0.00 0.00 392 0
dm-5 0.00 0.00 0.00 392 0
dm-6 0.00 0.00 0.00 56 8
# iostat -xtc 5 3 – gives you three outputs every 5 seconds.