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]#
Centos7下CPU内存等资源监控的更多相关文章
- Linux 性能监控之CPU&内存&I/O监控Shell脚本2
Linux 性能监控之CPU&内存&I/O监控Shell脚本2 by:授客 QQ:1033553122 思路: 捕获数据->停止捕获数据->提取数据 备注:一些命令的输 ...
- Linux 性能监控之CPU&内存&I/O监控Shell脚本1
Linux 性能监控之CPU&内存&I/O监控Shell脚本1 by:授客 QQ:1033553122 #!/bin/bash # 获取要监控的本地服务器IP地址 IP=`if ...
- centos7下安装docker(17docker监控---docker自带监控命令)
Docker自带的监控子命令 1.docker ps:docker ps -a这是我们常用的查看容器状态的命令 docker container ls和docker ps的功能一样 2.docker ...
- centos7下做内存盘的方法
在找这个资料的时候,基本没几个能用的或者过时了的,或者是换了概念,做的不是需要的那种盘,只有少数文章有提到关键部分应该怎么去操作,现在还是自己总结一下 内存盘tmpfs和ramdisk的区别 这个在网 ...
- 检测Windows程序的内存和资源泄漏之原生语言环境
最近接连收到大客户的反馈,我们开发的一个软件,姑且称之为App-E吧,在项目规模特别大的情况下,长时间使用会逐渐耗尽内存,运行越来越缓慢,软件最终崩溃.由于App-E是使用混合语言开发的,主界面使用C ...
- centOS7下实践查询版本/CPU/内存/硬盘容量等硬件信息
1.系统 1.1版本 uname -a 能确认是64位还是32位,其它的信息不多 [root@localhost ~]# uname -a Linux localhost.localdomain 3. ...
- centos7下安装docker(9容器对资源的使用限制-内存)
一个docker Host上面会运行若干容器,每个容器都需要CPU,内存和IO资源.容器提供了控制分配多少CPU,内存给每个容器的机制,避免摸个容器因占用太多资源而影响其他 ...
- Zabbix-(三)监控主机CPU、磁盘、内存并创建监控图形
Zabbix-(三)监控主机CPU.磁盘.内存并创建监控图形 一.前言 前文中已经讲述了两种方式对Zabbix的搭建,本文将讲述如何在zaibbx上添加需要监控的主机,以及使用Zabbix自带模板和自 ...
- [转帖]linux下CPU、内存、IO、网络的压力测试,硬盘读写速度测试,Linux三个系统资源监控工具
linux下CPU.内存.IO.网络的压力测试,硬盘读写速度测试,Linux三个系统资源监控工具 https://blog.51cto.com/hao360/1587165 linux_python关 ...
随机推荐
- 2018.07.22 洛谷P4316 绿豆蛙的归宿(概率dp)
传送门 简单的递推. 由于是DAG" role="presentation" style="position: relative;">DAGDA ...
- S3 exercise -- 文件操作&函数
编码 请说明python2 与python3中的默认编码是什么? # 答案 py2默认ASCII码,py3默认的utf8 为什么会出现中文乱码?你能列举出现乱码的情况有哪几种? # 答案 #codin ...
- Caused by: Unable to load configuration. - action - file:/C:/apache-tomcat-7.0.70/webapps/Structs/WEB-INF/classes/struts.xml:7:72 at com.opensymphony.xwork2.config.ConfigurationManager.getConfigurati
Unable to load configuration. - action - file:/C:/apache-tomcat-7.0.70/webapps/Structs/WEB-INF/class ...
- php mysql增删查改
php mysql增删查改代码段 $conn=mysql_connect('localhost','root','root'); //连接数据库代码 mysql_query("set na ...
- Proxy Hosted Virtual
http://books.sonatype.com/nexus-book/reference/confignx-sect-manage-repo.html Public Repositories 对外 ...
- _variant_t与其他数据类型的转换
转自:http://kuaixingdong.blog.hexun.com/29627840_d.html 我们先看看COM所支持的一些类型的基本类: (微软提供,在comdef.h中定义) 在COM ...
- poj 2591 Set Definition
题目 这道题是个水题,写博客上的人好像都不屑于写这这道题.但是我为什么还是觉得挺难的呢? 我也是看了别人的博客才过了的,感觉这种写法很新颖,这样就可以不用在排序了. 下面给出正解: #include& ...
- 初探FFT(快速傅里叶变换)
第一次接触省选的知识点呢!zrf大佬在课堂上讲的非常清楚,但由于本蒟蒻实在太菜了,直接掉线了.今天赶紧恶补一下. 那么这篇博客将分为两块,第一块是FFT的推导和实现,第二块则是FFT在OI上的应用 因 ...
- Microsoft Sql Server 2016安装在CentOS7下
安装过程 如何安装直接参考这个文章:安装sql server 整个安装过程非常简单. 上面的文档里是通过 sudo 命令,用root身份来执行,不过这里为了简单,就用root账号来安装的. (1)下载 ...
- mongodb 命令行安装
因为下载zip的文件速度快,所以就使用了zip,zip格式的解压完后需要使用命令行安装,步骤大致如下: 1,首先创建一个文件叫mongo的文件,里面包含了数据库存放的目录以及日志,然后在指定的目录下创 ...