zoukankan      html  css  js  c++  java
  • Centos7下CPU内存等资源监控

    1.查看内存使用情况:

    [root@takeout web-takeout]# free -m
                  total        used        free      shared  buff/cache   available
    Mem:           3788        1358        1096          17        1333        1886
    Swap:          3967          17        3950
    [root@takeout web-takeout]# 
    

      

    2.详细列出的进程情况,重点关注第10列内存使用占比:

    top - 15:36:09 up 8 days,  5:07,  2 users,  load average: 0.01, 0.02, 0.05
    Tasks: 330 total,   1 running, 329 sleeping,   0 stopped,   0 zombie
    %Cpu(s):  0.3 us,  1.3 sy,  0.0 ni, 98.3 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
    KiB Mem :  3879356 total,  1122336 free,  1391484 used,  1365536 buff/cache
    KiB Swap:  4063228 total,  4045192 free,    18036 used.  1931104 avail Mem 
    
      PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND                                                                                               
    22388 root      20   0  160080   2448   1532 R  11.8  0.1   0:00.03 top                                                                                                   
     7743 systemd+  20   0  343652  88800  13740 S   5.9  2.3 145:50.06 mongod                                                                                                
        1 root      20   0  191776   4560   2520 S   0.0  0.1   0:31.86 systemd                                                                                               
        2 root      20   0       0      0      0 S   0.0  0.0   0:00.19 kthreadd                                                                                              
        3 root      20   0       0      0      0 S   0.0  0.0   0:12.19 ksoftirqd/0                                                                                           
        5 root       0 -20       0      0      0 S   0.0  0.0   0:00.00 kworker/0:0H                                                                                          
        6 root      20   0       0      0      0 S   0.0  0.0   0:24.82 kworker/u32:0                                                                                         
        7 root      20   0       0      0      0 S   0.0  0.0   0:10.72 kworker/u33:0                                                                                         
        8 root      rt   0       0      0      0 S   0.0  0.0   0:00.40 migration/0                                                                                           
        9 root      20   0       0      0      0 S   0.0  0.0   0:00.00 rcu_bh                                                                                                
       10 root      20   0       0      0      0 S   0.0  0.0   4:56.04 rcu_sched                                                                                             
       11 root      rt   0       0      0      0 S   0.0  0.0   0:03.77 watchdog/0                                                                                            
       12 root      rt   0       0      0      0 S   0.0  0.0   0:03.86 watchdog/1                                                                                            
       13 root      rt   0       0      0      0 S   0.0  0.0   0:00.59 migration/1                                                                                           
       14 root      20   0       0      0      0 S   0.0  0.0   0:00.05 ksoftirqd/1                                                                                           
       16 root       0 -20       0      0      0 S   0.0  0.0   0:00.00 kworker/1:0H                                                                                          
       17 root      rt   0       0      0      0 S   0.0  0.0   0:03.87 watchdog/2                                                                                            
       18 root      rt   0       0      0      0 S   0.0  0.0   0:00.41 migration/2                                                                                           
       19 root      20   0       0      0      0 S   0.0  0.0   0:00.04 ksoftirqd/2                                                                                           
       21 root       0 -20       0      0      0 S   0.0  0.0   0:00.00 kworker/2:0H                                                                                          
       22 root      rt   0       0      0      0 S   0.0  0.0   0:03.91 watchdog/3                                                                                            
       23 root      rt   0       0      0      0 S   0.0  0.0   0:00.41 migration/3                                                                                           
       24 root      20   0       0      0      0 S   0.0  0.0   0:14.72 ksoftirqd/3                                                                                           
       26 root       0 -20       0      0      0 S   0.0  0.0   0:00.00 kworker/3:0H                                                                                          
       27 root      rt   0       0      0      0 S   0.0  0.0   0:03.87 watchdog/4                                                                                            
       28 root      rt   0       0      0      0 S   0.0  0.0   0:00.43 migration/4                                                                                           
       29 root      20   0       0      0      0 S   0.0  0.0   0:00.16 ksoftirqd/4    
    

      

    3.查看消耗内存最多的前40个进程:

    [root@takeout web-takeout]# ps auxw|head -1;ps auxw|sort -rn -k4|head -40
    USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
    root     29801  2.9 18.3 2821716 711956 ?      Ssl  10:58   8:17 java -Djava.security.egd=file:/dev/./urandom -jar /app.jar
    systemd+  2919  0.1  4.9 1452544 191028 ?      Ssl  7月02  15:40 mysqld
    systemd+  7743  1.2  2.2 343652 88800 ?        SLsl 7月02 145:50 mongod --auth --storageEngine wiredTiger
    root      1524  0.8  1.4 1627344 54956 ?       Ssl  7月02  96:06 /usr/bin/dockerd
    root      1534  0.2  0.4 1188184 16012 ?       Ssl  7月02  25:54 docker-containerd -l unix:///var/run/docker/libcontainerd/docker-containerd.sock --metrics-interval=0 --start-timeout 2m --state-dir /var/run/docker/libcontainerd/containerd --shim docker-containerd-shim --runtime docker-runc
    root       607  0.0  0.3  45024 15048 ?        Ss   7月02   0:08 /usr/lib/systemd/systemd-journald
    root      1122  0.0  0.3 562600 14716 ?        Ssl  7月02   2:29 /usr/bin/python -Es /usr/sbin/tuned -l -P
    root       887  0.0  0.2 470312  9540 ?        Ssl  7月02   0:26 /usr/sbin/NetworkManager --no-daemon
    root       861  0.0  0.2 220312 10996 ?        Ssl  7月02   0:52 /usr/sbin/rsyslogd -n
    polkitd    851  0.0  0.2 536336 11584 ?        Ssl  7月02   0:06 /usr/lib/polkit-1/polkitd --no-debug
    root       856  0.0  0.1 216988  4788 ?        Ss   7月02   0:00 /usr/bin/abrt-watch-log -F BUG: WARNING: at WARNING: CPU: INFO: possible recursive locking detected ernel BUG at list_del corruption list_add corruption do_IRQ: stack overflow: ear stack overflow (cur: eneral protection fault nable to handle kernel ouble fault: RTNL: assertion failed eek! page_mapcount(page) went negative! adness at NETDEV WATCHDOG ysctl table check failed : nobody cared IRQ handler type mismatch Machine Check Exception: Machine check events logged divide error: bounds: coprocessor segment overrun: invalid TSS: segment not present: invalid opcode: alignment check: stack segment: fpu exception: simd exception: iret exception: /var/log/messages -- /usr/bin/abrt-dump-oops -xtD
    root       854  0.0  0.1 219484  4204 ?        Ss   7月02   0:00 /usr/sbin/abrtd -d -s
    root      7725  0.2  0.1 347456  4076 ?        Sl   7月02  33:09 docker-containerd-shim cfb7edfcbd710751322362ea32dc3025a5f28818e608ea34ce897206937b1333 /var/run/docker/libcontainerd/cfb7edfcbd710751322362ea32dc3025a5f28818e608ea34ce897206937b1333 docker-runc
    root      7719  0.0  0.1 911148  6888 ?        Sl   7月02   1:34 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 9999 -container-ip 172.17.0.4 -container-port 27017
    root      3165  0.0  0.1 414656  4056 ?        Sl   7月02   0:01 docker-containerd-shim f532147cc4de43223fe2bf9641b1d84147f0f6a297c3d1792ccc5bd0070eb12e /var/run/docker/libcontainerd/f532147cc4de43223fe2bf9641b1d84147f0f6a297c3d1792ccc5bd0070eb12e docker-runc
    root      3076  0.0  0.1  36992  7608 ?        Ssl  7月02   6:28 /usr/bin/redis-server *:6379
    root     29784  0.0  0.1 412992  3996 ?        Sl   10:58   0:00 docker-containerd-shim aa2d5e47a9b9a9624966fd3839128e78eec8f155931c3074439e2d61cd50a044 /var/run/docker/libcontainerd/aa2d5e47a9b9a9624966fd3839128e78eec8f155931c3074439e2d61cd50a044 docker-runc
    root     18707  0.0  0.1 117264  4020 pts/1    Ss   09:13   0:00 -bash
    root     18659  0.0  0.1 117240  4004 pts/0    Ss+  09:12   0:00 -bash
    root     18656  0.0  0.1 150376  5828 ?        Ss   09:12   0:00 sshd: root@pts/0,pts/1
    root      1120  0.0  0.1 105996  4112 ?        Ss   7月02   0:00 /usr/sbin/sshd -D
    root     11101  0.0  0.1 150376  5892 ?        Ss   13:31   0:00 sshd: root@notty
    root         1  0.0  0.1 191776  4560 ?        Ss   7月02   0:31 /usr/lib/systemd/systemd --switched-root --system --deserialize 21
    postfix  20269  0.0  0.1  91732  4036 ?        S    15:15   0:00 pickup -l -t unix -u
    postfix   1326  0.0  0.1  91800  4036 ?        S    7月02   0:01 qmgr -l -t unix -u
    zabbix   31681  0.0  0.0  83944  2192 ?        S    11:18   0:01 /usr/sbin/zabbix_agentd: active checks #1 [idle 1 sec]
    zabbix   31680  0.0  0.0  83936  2436 ?        S    11:18   0:09 /usr/sbin/zabbix_agentd: listener #3 [waiting for connection]
    zabbix   31679  0.0  0.0  83936  2440 ?        S    11:18   0:08 /usr/sbin/zabbix_agentd: listener #2 [waiting for connection]
    zabbix   31678  0.0  0.0  83936  2440 ?        S    11:18   0:08 /usr/sbin/zabbix_agentd: listener #1 [waiting for connection]
    zabbix   31677  0.0  0.0  83812  2424 ?        S    11:18   0:08 /usr/sbin/zabbix_agentd: collector [idle 1 sec]
    zabbix   31675  0.0  0.0  83812  1260 ?        S    11:18   0:00 /usr/sbin/zabbix_agentd -c /etc/zabbix/zabbix_agentd.conf
    USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
    root        99  0.0  0.0      0     0 ?        S<   7月02   0:00 [bioset]
    root        98  0.0  0.0      0     0 ?        S<   7月02   0:00 [kintegrityd]
    root        97  0.0  0.0      0     0 ?        S<   7月02   0:00 [writeback]
    root        96  0.0  0.0      0     0 ?        S    7月02   0:02 [khungtaskd]
    root      9573  0.0  0.0      0     0 ?        S    7月07   0:02 [kworker/7:2]
    root        95  0.0  0.0      0     0 ?        S<   7月02   0:00 [netns]
    root        94  0.0  0.0      0     0 ?        S    7月02   0:00 [kdevtmpfs]
    root       904  0.0  0.0 110044   820 tty1     Ss+  7月02   0:00 /sbin/agetty --noclear tty1 linux
    [root@takeout web-takeout]# 
    

      

  • 相关阅读:
    构造函数
    Jquery mobiscroll 移动设备(手机)wap日期时间选择插件以及滑动、滚动插件
    制作网页logo
    css兼容写法
    无刷新分页
    1009. Complement of Base 10 Integer (E)
    1288. Remove Covered Intervals (M)
    前端开发设置字符的间距和文字的间距
    前端开发字体属性合写
    前端开发设置字体的样式
  • 原文地址:https://www.cnblogs.com/amoyzhu/p/9289470.html
Copyright © 2011-2022 走看看