Linux系统性能分析思路

2020-03-28  本文已影响0人  猿二胖
1、系统负载监控
$ uptime
16:33  up 48 days, 17:04, 2 users, load averages: 1.38 1.25 1.26

备注:
16:33 : 当前系统时间
up 48 days, 17:04 系统运行时间,时间越长说明系统越稳定
2 users:当前登陆用户数
load averages: 1.38 1.25 1.26 过去1分钟、5分钟、15分钟内的平均负载,

top:对系统所有运行的进程和系统载荷提供不断的更新的概览信息

top - 17:29:49 up 45 days, 23:44,  2 users,  load average: 0.00, 0.01, 0.05
Tasks:  78 total,   1 running,  77 sleeping,   0 stopped,   0 zombie
%Cpu(s):  0.7 us,  0.7 sy,  0.0 ni, 98.3 id,  0.3 wa,  0.0 hi,  0.0 si,  0.0 st
KiB Mem :  1882752 total,    84464 free,   182124 used,  1616164 buff/cache
KiB Swap:        0 total,        0 free,        0 used.  1497328 avail Mem 

  PID USER      PR  NI    VIRT    RES    SHR S %CPU %MEM     TIME+ COMMAND                                                           
 1569 root      20   0  158160   9036   1756 S  0.3  0.5  31:44.26 barad_agent                                                       
 1570 root      20   0  609120  11644   1972 S  0.3  0.6 160:13.13 barad_agent  

注:

# 统计物理cpu个数
[root@sell180 ~]# cat /proc/cpuinfo | grep 'physical id' | sort | uniq | wc -l
# 统计cpu核数
[root@sell180 ~]# cat /proc/cpuinfo | grep 'cpu cores' | uniq
# 统计逻辑cpu个数
[root@sell180 ~]# cat /proc/cpuinfo | grep 'processor' | wc -l 
# 查看CPU信息(型号)
[root@sell180 ~]# cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c
上一篇下一篇

猜你喜欢

热点阅读