Linux查看最消耗内存,CPU资源的进程
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了Linux查看最消耗内存,CPU资源的进程,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2801字,纯文字阅读大概需要5分钟。
内容图文
![Linux查看最消耗内存,CPU资源的进程](/upload/InfoBanner/zyjiaocheng/973/d95799e2f28c494891884e479b18556e.jpg)
1. 查看消耗CPU资源最多的前10个进程
[root@localhost ~]# ps auxw | head -1;ps auxw |sort -rn -k3 |head -11
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1456 4.7 1.4 1128168 28884 ? S<l Mar30 269:35 /usr/local/vpnserver/vpnserver execsvc
root 10763 1.0 0.0 110240 1176 pts/1 R+ 17:00 0:00 ps auxw
zabbix 10522 0.0 0.1 81476 2344 ? S Apr02 0:05 /usr/sbin/zabbix_agentd: active checks #1 [idle 1 sec]
zabbix 10521 0.0 0.0 81336 1532 ? S Apr02 0:19 /usr/sbin/zabbix_agentd: collector [idle 1 sec]
zabbix 10519 0.0 0.0 81336 1420 ? S Apr02 0:00 /usr/sbin/zabbix_agentd -c /etc/zabbix/zabbix_agentd.conf
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 969 0.0 0.0 0 0 ? S Mar30 0:00 [kauditd]
root 9491 0.0 0.0 108316 1904 pts/0 Ss+ Mar31 0:00 -bash
root 9486 0.0 0.2 100060 4060 ? Ss Mar31 0:00 sshd: root@pts/0
root 916 0.0 0.0 0 0 ? S Mar30 0:00 [ext4-dio-unwrit]
root 915 0.0 0.0 0 0 ? S Mar30 0:00 [jbd2/sda2-8]
[root@localhost ~]#
2. 查看消耗内存资源最多的前10个进程
[root@localhost ~]# ps auxw | head -1;ps auxw |sort -rn -k4 |head -11
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1456 4.7 1.4 1128168 28884 ? S<l Mar30 269:49 /usr/local/vpnserver/vpnserver execsvc
root 9486 0.0 0.2 100060 4060 ? Ss Mar31 0:00 sshd: root@pts/0
root 10449 0.0 0.2 100056 4036 ? Ss Apr02 0:00 sshd: root@pts/1
zabbix 10522 0.0 0.1 81476 2344 ? S Apr02 0:05 /usr/sbin/zabbix_agentd: active checks #1 [idle 1 sec]
root 9082 0.0 0.1 12016 2276 ? S< Mar30 0:00 /sbin/udevd -d
root 9068 0.0 0.1 12140 2404 ? S< Mar30 0:00 /sbin/udevd -d
root 1426 0.0 0.1 81012 3464 ? Ss Mar30 0:01 /usr/libexec/postfix/master
postfix 1431 0.0 0.1 81260 3484 ? S Mar30 0:00 qmgr -l -t fifo -u
postfix 10748 0.0 0.1 81092 3440 ? S 15:47 0:00 pickup -l -t fifo -u
zabbix 10521 0.0 0.0 81336 1532 ? S Apr02 0:19 /usr/sbin/zabbix_agentd: collector [idle 1 sec]
zabbix 10519 0.0 0.0 81336 1420 ? S Apr02 0:00 /usr/sbin/zabbix_agentd -c /etc/zabbix/zabbix_agentd.conf
[root@localhost ~]#
3. 如下指令也是同样效果(按照cpu,内存等)
ps auxw --sort=rss
ps auxw --sort=%cpu
ps auxw --sort=%mem
4. 几个参数的含义
-
%MEM 进程的内存占用率
-
MAJFL is the major page fault count,
-
VSZ 进程所使用的虚存的大小
-
RSS 进程使用的驻留集大小或者是实际内存的大小(RSS is the "resident 5. set size" meaning physical memory used)
-
TTY 与进程关联的终端(tty)
内容总结
以上是互联网集市为您收集整理的Linux查看最消耗内存,CPU资源的进程全部内容,希望文章能够帮你解决Linux查看最消耗内存,CPU资源的进程所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。