solaris 查看CPU资源占用情况!

当然首先是vmstat 抽样数据了!
vmstat 3 10 频率间隔3秒抽样10次
数据出来了主要看 us sy id 对应数值 us 用户占用cpu sy 系统占用cpu id 空闲时间!长期小于100说明cpu的负载重 我的抽样是长期为0 说明程序长期占用cpu.

其次 ps -eo pid,pcpu,args | sort +1n
该命令输出当前系统进程的pid, cpu占用率及命令描述,并以pcpu来排序
#ps -eo pid,pcpu,args | sort +1n
18179 49.1 /usr/dt/bin/dthello
19482 49.3 /usr/dt/bin/dthello

第三是 prstat -a
# prstat -a
   PID USERNAME SIZE   RSS STATE PRI NICE      TIME      CPU PROCESS/NLWP      
18179    test           7160K 3624K run     30    0        316:37:11 49% dthello/1
19482    test          7160K 3640K cpu0    30    0       316:24:43 49% dthello/1

原文地址:https://www.cnblogs.com/storymedia/p/4436204.html