1.顶部命令

Top - 10:57:46 Up 3分钟,2个用户,装载平均:1.24,0.86,0.35
任务:66人,3次运行,63睡眠,0停止,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总计565316K,466728K免费,13536K缓冲区
SWAP:2128604K总计,0K使用,2128604K免费,238368K缓存

  PID用户Pr Ni virt res res shr s%cpu%mem time +命令
 5523根15 0 98584 31M 14M S 0.3 3.1 0:00.97 SVRServer
    1根15 0 1648 536 468 S 0.0 0.1 0:00.50 init
    2根RT-5 0 0 0 S 0.0 0.0 0:00.00迁移/ 0
    3根15 0 0 0 0 0 0.0 0.0 0.0 0:00.00 ksoftirqd / 0
    4根RT-5 0 0 0 S 0.0 0.0 0:00.00看门狗/ 0
    5根10 -5 0 0 0 0.00.0 0.0 0.0 0:00.00事件/ 0
    6根10 -5 0 0 0 0.0 0.0 0.0 0.0 0:00.00 khelper
    7根11-5 0 0 0 0.0 0.0 0.0 0.0 0:00.00 kthread
    8根RT-5 0 0 0 D 0.0 0.0 0:00.00 kmem_kthread
   11根10 -5 0 0 0 0.00.0 0.0 0.0 0:00.04 KBLOCKD / 0
   12根20 -5 0 0 0 0.0 0.0 0.0 0.00 0:00.00 kacpid
  176 root 19 -5 0 0 0 0 0.0 0.0 0.0 0:00.00 cqueue / 0
  179 root 19 -5 0 0 0 0.0 0.0 0.0 0:00.00 Khubd
  181根10 -5 0 0 0 0.00.0 0.0 0.0 0:00.00 kseriod
  244根24 0 0 0 0 0.0 0.0 0.0 0:00.00 PDFLUSH
  245根15 0 0 0 0 0.0 0.0 0.0 0:00.02 PDFLUSH

2. mpstat命令以单独使用每个CPU

#mpstat.
Linux. 2.6.18-92CP(CP-FW-1)05/08/13

10:36:06 CPU%用户%INDS%SYS%iowait%IRQ%软件%窃取%空闲INTL / s
10:36:06全部8.03 0.00 1.35 0.27 0.03 0.11.00 0.11 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%IND%SYS%iowait%IRQ%软件窃取%空闲INTL / s
10:36:47全部8.03 0.00 1.35 0.27 0.03 0.1. 0.11 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命令显示当今的CPU活动

# SAR.
Linux. 2.6.18-92CP(CP-FW-1)05/08/13

00:00:01 CPU%用户%nice%system%iowait%窃取%空闲
00:10:01全部8.42 0.00 1.65 0.29 0.00 89.64
00:20:01全部8.47 0.00 1.62 0.33 0.00 89.57
00:30:01所有10.95 0.00 1.61 0.28 0.00 87.16
00:40:01全部8.42 0.00 1.64 0.00 0.00 0.00 89.64
00:50:01全部8.43 0.00 1.66 0.26 0.00 89.66
01:00:01全部8.44 0.00 1.60 0.26 0.00 89.70
01:10:02全部8.43 0.00 1.67 0.33 0.00 89.57
01:20:01全部8.44 0.00 1.66 0.25 0.00 0.00 89.65
01:30:01所有10.86 0.00 1.69 0.31 0.00 87.14
01:40:01全部8.41 0.00 1.63 0.33 0.00 89.62
01:50:01全部8.41 0.00 1.60 0.29 0.00 89.70
02:00:01全部8.40 0.00 1.59 0.27 0.00 89.75
02:10:01全部8.40 0.00 1.64 0.00 0.00 0.00 89.67
02:20:01全部8.40 0.00 1.58 0.28 0.00 89.74
02:30:01全部10.86 0.00 1.63 0.25 0.00 87.26
02:40:01全部8.41 0.00 1.62 0.24 0.00 89.73
02:50:01全部8.41 0.00 1.64 0.34 0.00 89.61
03:00:01全部8.40 0.00 1.59 0.29 0.00 89.71
03:10:01全部8.42 0.00 1.60 0.29 0.00 89.68
03:20:01全部8.41 0.00 1.58 0.31 0.00 89.69
03:30:01所有10.9 0.00 1.64 0.31 0.00 87.11
03:40:01全部8.42 0.00 1.62 0.24 0.00 89.72
03:50:01全部8.42 0.00 1.60 0.36 0.00 89.62
04:00:01全部8.39 0.00 1.60 0.29 0.00 89.72
04:10:01全部8.40 0.00 1.62 0.26 0.00 89.72
04:20:01全部8.40 0.00 1.60 0.000 0.00 0.00 89.70
04:30:01所有10.90 0.00 1.73 0.00 0.00 0.00 87.07
04:40:01全部8.43 0.00 1.67 0.27 0.00 89.63
04:50:01全部8.43 0.00 1.67 0.28 0.00 89.62
05:00:01全部8.45 0.00 1.94 0.31 0.00 89.29
05:10:01全部8.55 0.00 1.99 0.32 0.00 89.15
05:20:02全部8.47 0.00 1.94 0.00 0.00 0.00 89.29
05:30:01全部10.91 0.00 1.74 0.27 0.00 87.09
05:40:01全部8.49 0.00 2.19 0.27 0.00 89.05
05:50:01全部8.43 0.00 1.64 0.26 0.00 89.68
06:00:01全部8.41 0.00 1.71 0.29 0.00 89.58
06:10:01全部8.43 0.00 1.61 0.27 0.00 89.69
06:20:01全部8.41 0.00 1.61 0.28 0.00 89.70
06:30:01全部10.92 0.00 1.65 0.36 0.00 87.08
06:40:01全部8.53 0.00 2.00 0.00 0.00 89.16
06:50:01全部8.42 0.00 1.71 0.33 0.00 89.55
07:00:01全部8.43 0.00 1.59 0.27 0.00 89.71
07:10:01全部8.44 0.00 1.60 0.28 0.00 89.69
07:20:01全部8.42 0.00 1.63 0.27 0.00 89.68
07:30:01全部10.84 0.00 1.61 0.31 0.00 87.24
07:40:01全部8.44 0.00 1.61 0.27 0.00 89.69
07:50:01全部8.45 0.00 1.63 0.27 0.00 89.66
08:00:01全部8.46 0.00 1.65 0.25 0.00 89.64
08:10:01全部8.41 0.00 1.60 0.29 0.00 89.70
08:20:01全部8.39 0.00 1.60 0.30 0.00 0.00 89.71
08:30:01全部10.88 0.00 1.61 0.29 0.00 87.22
08:40:01全部8.42 0.00 1.65 0.27 0.00 89.66
08:50:01全部8.42 0.00 1.59 0.28 0.00 89.71
09:00:01全部8.41 0.00 1.60 0.25 0.00 0.00 89.73
09:10:01全部8.43 0.00 1.60 0.30 0.00 0.00 0 89.67
09:20:01全部8.41 0.00 1.64 0.29 0.00 89.66
09:30:02所有10.86 0.00 1.62 0.25 0.00 87.27
09:40:01全部8.50 0.00 1.61 0.32 0.00 89.58
09:50:01全部8.44 0.00 1.59 0.33 0.00 89.63
10:00:01全部8.41 0.00 1.63 0.28 0.00 89.68
10:10:01全部8.39 0.00 1.60 0.33 0.00 89.67
10:20:01全部8.42 0.00 1.58 0.28 0.00 89.72
10:30:01所有10.87 0.00 1.63 0.37 0.00 87.13
平均:全部8.86 0.00 1.66 0.29 0.00 89.19

SAR -U 2 5显示CPU利用率的比较; 2秒分开; 5次,

# SAR -U 2 5
Linux. 2.6.18-92CP(CP-FW-1)05/08/13
10:38:11 CPU%用户%nice%system%iowait%窃取%空闲
10:38:13所有0.25 0.00 1.50 0.25 0.00 0.00 0.00 98.00
10:38:15全部0.25 0.00 1.00 0.25 0.00 0.00 98.50
10:38:17所有0.25 0.00 1.00 0.25 0.00 98.50
10:38:19所有0.25 0.00 1.00 0.25 0.00 0.00 98.50
10:38:21全部0.25 0.00 1.75 0.00 0.00 0.00 98.00
平均:所有0.25 0.00 1.25 0.20 0.00 0.00 98.30

4. ps命令找出谁是垄断或吃cpus

# PS -eo PCPU,PID,用户,args |排序-k 1 -r |头-10
82.0 12192管理员FW CTL Affinity -L -V
%CPU PID用户命令
 0.4 5052 admin / bin / searchd
 0.3 5322管理员CPD
 0.1 11353 admin / bin / clish
 0.1 6609管理员Daservice>/opt/cpda/bin/da.out.
 0.1 5054 admin / bin / monitord
 0.1 3896 admin [kjournald]
 0.0 24478 Admin / Sbin / Agetty 9600 TTYS0 VT100
 0.0 24471 Admin / Bin / Bash / Bin / Console_agetty
# PS -eo PCPU,PID,用户,args | sort -r -k1 |较少的
%CPU PID用户命令
 0.4 5052 admin / bin / searchd
 0.3 5322管理员CPD
 0.1 11353 admin / bin / clish
 0.1 6609管理员Daservice>/opt/cpda/bin/da.out.
 0.1 5054 admin / bin / monitord
 0.1 3896 admin [kjournald]
 0.0 24478 Admin / Sbin / Agetty 9600 TTYS0 VT100
 0.0 24471 Admin / Bin / Bash / Bin / Console_agetty
 0.0 19410 admin / bin / lvmcmd_d
 0.0 19409 Nobody / Opt/cpshrd-r75.40/web/apache/2.2.0/bin/httpd2 -k start -f / web/conf/httpd2.conf -d前景
 0.0 19407 Nobody / Opt/cpshrd-r75.40/web/apache/2.2.0/bin/httpd2 -k start -f / web/conf/httpd2.conf -d前景
 0.0 19406 Nobody / Opt/cpshrd-r75.40/web/apache/2.2.0/bin/httpd2 -k start -f / web/conf/httpd2.conf -d前景
 0.0 19405 Nobody / Opt/cpshrd-r75.40/web/apache/2.2.0/bin/httpd2 -k start -f / web/conf/httpd2.conf -d前景
 0.0 19400 admin / opt/cpshrd-r75.40/web/apache/2.2.0/bin/httpd2 -k start -f / web/conf/httpd2.conf -d前景
 0.0 12314管理[较少]
 0.0 12313管理排序-r -k1
 0.0 12312管理PS -eo PCPU,PID,用户,args
 0.0 11468 admin / bin / bash
 0.0 11363 Admin / Bin / Clishd服务11353 
 0.0 11302管理SSHD: [电子邮件 protected]/2   
 0.0 10036 admin睡眠3600
 0.0 6728 Admin / Sbin / Agetty 9600 TTY3
 0.0 6723管理/ SBIN / AGETTY 9600 TTY2
 0.0 6721 Admin / Sbin / Agetty 9600 TTY1
 0.0 6601管理员RTMD
 0.0 5921 admin in.geod 0
 0.0 5920 Admin DTLSD 0
 0.0 5874管理员VPND 0
 0.0 5871 admin in.aufpd 0
 0.0 5870 admin in.asessiond 0
 0.0 5652 admin / bin / outed-n
 0.0 5637管理员FWD
 0.0 5625 nobody ci_http_server -j -f /opt/cpsuite-r75.40/fw1/conf/cihs.conf
 0.0 5618 admin / bin / csh -f /opt/cpsuite-r75.40/fw1/bin/avi_del_tmp_files
 0.0 5612 admin / opt/cpsuite-r75.40/fw1/bin/cphamcset
 0.0 5344 admin mpdaemon /opt/cpshrd-r75.40/log/mpdaemon.elg /opt/cpshrd-r75.40/conf/mpdaemon.conf
 0.0 5308管理/ opt/cpshrd-r75.40/bin/cpwd
 0.0 5275 admin /opt/cpshrd-r75.40/bin/cprid
 0.0 0.0 5255 admin / bin / csh -fb /opt/cpshrd-r75.40/bin/cprid_wd
 0.0 5216 admin crond
 0.0 5202管理xinetd -stayalive -pidfile /var/run/xinetd.pid
 0.0 5178管理/ usr / sbin / sshd -4
 0.0 5139 admin / usr / sbin / acpid
 0.0 5106 admin / bin / clish -p -p
 0.0 5105 admin / bin / frontstage
 0.0 5103 admin / bin / clishd默认服务器
 0.005051 admin / bin / confd
 0.0 5031 admin / bin / pm
 0.0 4648管理klogd -x -c 1
 0.0 4643管理Syslogd -m 0-z 515 -f /var/run/syslog.conf
 0.0 4620管理员审核
 0.0 4484 admin [fw_worker_1]
 0.0 4419 admin [fw_worker_0]
 0.0 3893 admin [kjournald]
 0.0 512 admin / sbin / udevd -d
 0.0 479 admin [kauditd]
 0.0 452 admin [kjournald]
 0.044 admin [ksnapd]
 0.0 425 admin [scsi_eh_1]
 0.0 424 admin [scsi_eh_0]
 0.0 420 admin [ata_aux]
 0.0 419管理[ATA / 1]
 0.0 418管理[ATA / 0]
 0.0 383 admin [kpsmoused]
 0.0 217 admin [aio / 1]

5. iostat命令以自上次重新启动以来报告设备和分区的CPU统计信息和输入/输出统计信息。 

# iostat
Linux. 2.6.18-92CP(CP-FW-1)05/08/13

avg-cpu:%用户%nice%system%iowait%窃取%空闲
           8.03 0.00 1.56 0.27 0.00 90.14

设备: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 0.00 392 0
DM-3 0.00 0.00 0.00 0.00 392 0
DM-4 0.00 0.00 0.00 0.00 392 0
DM-5 0.00 0.00 0.00 0.00 392 0
DM-6 0.00 0.00 0.00 56 8


#IOSTAT -XTC 5 3 - 为您提供每5秒的三个输出。 

Linux. 2.6.18-92CP(CP-FW-1)05/08/13
时间:10:44:13
avg-cpu:%用户%nice%system%iowait%窃取%空闲
           8.03 0.00 1.56 0.27 0.00 90.14
时间:10:44:18
avg-cpu:%用户%nice%system%iowait%窃取%空闲
           0.30 0.00 0.80 0.0 0.00 0.00 98.50
时间:10:44:23
avg-cpu:%用户%nice%system%iowait%窃取%空闲
           0.30 0.00 0.90 0.10 0.00 0.00 98.70

经过 Jon.

发表评论