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]#

  

Centos7下CPU内存等资源监控的更多相关文章

  1. Linux 性能监控之CPU&内存&I/O监控Shell脚本2

    Linux 性能监控之CPU&内存&I/O监控Shell脚本2   by:授客 QQ:1033553122 思路: 捕获数据->停止捕获数据->提取数据 备注:一些命令的输 ...

  2. Linux 性能监控之CPU&内存&I/O监控Shell脚本1

    Linux 性能监控之CPU&内存&I/O监控Shell脚本1   by:授客 QQ:1033553122   #!/bin/bash # 获取要监控的本地服务器IP地址 IP=`if ...

  3. centos7下安装docker(17docker监控---docker自带监控命令)

    Docker自带的监控子命令 1.docker ps:docker ps -a这是我们常用的查看容器状态的命令 docker  container ls和docker ps的功能一样 2.docker ...

  4. centos7下做内存盘的方法

    在找这个资料的时候,基本没几个能用的或者过时了的,或者是换了概念,做的不是需要的那种盘,只有少数文章有提到关键部分应该怎么去操作,现在还是自己总结一下 内存盘tmpfs和ramdisk的区别 这个在网 ...

  5. 检测Windows程序的内存和资源泄漏之原生语言环境

    最近接连收到大客户的反馈,我们开发的一个软件,姑且称之为App-E吧,在项目规模特别大的情况下,长时间使用会逐渐耗尽内存,运行越来越缓慢,软件最终崩溃.由于App-E是使用混合语言开发的,主界面使用C ...

  6. centOS7下实践查询版本/CPU/内存/硬盘容量等硬件信息

    1.系统 1.1版本 uname -a 能确认是64位还是32位,其它的信息不多 [root@localhost ~]# uname -a Linux localhost.localdomain 3. ...

  7. centos7下安装docker(9容器对资源的使用限制-内存)

                  一个docker Host上面会运行若干容器,每个容器都需要CPU,内存和IO资源.容器提供了控制分配多少CPU,内存给每个容器的机制,避免摸个容器因占用太多资源而影响其他 ...

  8. Zabbix-(三)监控主机CPU、磁盘、内存并创建监控图形

    Zabbix-(三)监控主机CPU.磁盘.内存并创建监控图形 一.前言 前文中已经讲述了两种方式对Zabbix的搭建,本文将讲述如何在zaibbx上添加需要监控的主机,以及使用Zabbix自带模板和自 ...

  9. [转帖]linux下CPU、内存、IO、网络的压力测试,硬盘读写速度测试,Linux三个系统资源监控工具

    linux下CPU.内存.IO.网络的压力测试,硬盘读写速度测试,Linux三个系统资源监控工具 https://blog.51cto.com/hao360/1587165 linux_python关 ...

随机推荐

  1. 2018.09.16 loj#10242. 取石子游戏 2(博弈论)

    传送门 同样有一个显然的结论. 如果a1a_1a1​ xorxorxor a2a_2a2​ xorxorxor a3a_3a3​ xor...xor...xor... xorxorxor ana_na ...

  2. 41 Pain and Pain Management 疼痛与疼痛管理

    Pain and Pain Management 疼痛与疼痛管理 ①Years ago,doctors often said that pain was a normal part of life.I ...

  3. HDU 2138 How many prime numbers (判素数,米勒拉宾算法)

    题意:给定一个数,判断是不是素数. 析:由于数太多,并且太大了,所以以前的方法都不适合,要用米勒拉宾算法. 代码如下: #include <iostream> #include <c ...

  4. Spring mvc,jQuery和JSON数据交互

    一.实验环境的搭建 1.Spring mvc jar. 导入spring mvc运行所需jar包.导入如下(有多余) 2.json的支持jar 3.加入jQuery. 选用jquery-3.0.0.m ...

  5. C++中的数组问题

    C++中的数组问题 1. 数组赋值与初始化 (1)直接初始化: ]={,,}: (2)遍历访问初始化: ;i< ;i++) //直接读入,或者用别的数组,以及别的(i+1)等. (3)内存操作函 ...

  6. Amazon成本和产出的衡量方式

    Amazon用一种T-Shirt Size 估计的方式来做项目. 产品经理会对每一条需求评估上业务影响力的尺寸,如:XXXL 影响一千万人以上或是可以占到上亿美金的市场,XXL,影响百万用户或是占了千 ...

  7. shell 脚本 批量修改文件名

    修改文件名前 #!/bin/bask # for a in $( ls /etc/yum.repos.d/CentOS* );do if [ $a != '/etc/yum.repos.d/CentO ...

  8. 【笔记】virtualbox+arch+kde5安装流水账

    正常安装就是RTFD就行了,不行辅助这几个链接也行: 我先把整个脚本[1]放这里: loadkeys us parted mkfs.ext4 /dev/sda1mkfs.ext4 /dev/sda3 ...

  9. Nodejs书写爬虫工具

    看了几天的nodejs,的确是好用,全当是练手了,就写了一个爬虫工具. 爬虫思路都是一致的,先抓取页面数据,然后分析页面,获取到所需要的数据,最后获得这些数据,是写入到硬盘,还是显示到网页,自己看着办 ...

  10. Swiper使用方法(向前和向后按钮在swiper-container外面)

    Swiper插件的使用 1.HTML <!-- Swiper --> <section class="swipper"> <div class=&qu ...