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. 《完全版线段树》——notonlysuccess

    转载自:NotOnlySuccess的博客 [完全版]线段树 很早前写的那篇线段树专辑至今一直是本博客阅读点击量最大的一片文章,当时觉得挺自豪的,还去pku打广告,但是现在我自己都不太好意思去看那篇文 ...

  2. UVa 11167 Monkeys in the Emei Mountain (最大流)

    题意:雪雪是一只猴子.它在每天的 2:00 —— 9:00之间非常渴,所以在这个期间它必须喝掉2个单位的水.它可以多次喝水,只要它喝水的总量是2.它从不多喝,在一小时内他只能喝一个单位的水.所以它喝水 ...

  3. 基于NLP和GAN的小说影视化

    轮廓: https://tieba.baidu.com/p/1271120336 着色:

  4. Sharepoint/Project Server 看不到“安全性”菜单以及子菜单

    在Sharepoint/Project Server 构建后,左侧看不到看不到“服务器设置”菜单,在设置菜单后左侧出现“服务器设置”菜单,但是依然在右侧看不到“安全性”菜单以及子菜单. (这个图是借的 ...

  5. CSS/CSS3

    CSS/CSS3 选择器. 选择器 例子 例子描述 CSS 说明 .class .intro 选择 class="intro" 的所有元素. 1 #id #firstname 选择 ...

  6. dorado7-HelloWorld

    1.首先在Tomat中将 Auto reloding enable去掉,去掉的目的不用每次更改代码,都要重新部署 2.创建dorado视图文件 2.1 视图文件的格式为xml 2.2 在view中添加 ...

  7. 蚂蚁男孩.队列组件(Framework.Mayiboy.Queue)

    它能做什么 主要是用来方便使用队列而诞生,该组件封装了Queue和Redis中的队列,能够通过简单配置就可以高效快速使用起来. 使用说明 一.    下载源码,自己手动编译,手动引用必要的程序集.(需 ...

  8. C#一些代码小结--文件对话框

    C# 一些代码小结--文件对话框 查看文件完整路径 try { Config cfg = new Config(); var file = ""; if (saveFileDial ...

  9. 我的第一个网络爬虫 C#版 福利 程序员专车

    最近在自觉python,看到了知乎上一篇文章(https://www.zhihu.com/question/20799742),在福利网上爬视频... 由是我就开始跟着做了,但答主给的例子是基于pyt ...

  10. UWP开发入门(六)——对多设备不同分辨率显示效果的讨论

    本篇不涉及具体代码,而是把实际开发UWP APP的过程中,遇到的不同设备,不同分辨率显示效果差异的问题进行讨论.希望能够抛砖引玉,和各位擦出一些火花. 蜀黍我目前是在做一套牛逼的UWP APP啦,目标 ...