linux查看占用cpu高的进程

发布时间:2021-04-27 22:24:54 阅读:1553次

在linux服务器中,我们如何查看cpu占用最高的进程

ps aux|head -1;ps aux|grep -v PID|sort -rn -k +3|head
[root@iZbp1fna7ky0qz2jbj7gfpZ wwwlogs]# ps aux|head -1;ps aux|grep -v PID|sort -rn -k +3|head
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root      1371  1.3  1.7 138184 18124 ?        S<sl 15:53   5:20 /usr/local/aegis/aegis_client/aegis_10_95/AliYunDun
redis     1273  0.4  0.8 162568  9124 ?        Ssl  15:53   1:35 /www/server/redis/src/redis-server 127.0.0.1:6379
yansiyu   5420  0.0  0.1 115548  2008 pts/1    Ss   22:22   0:00 -bash
yansiyu   5419  0.0  0.2 157512  2320 ?        S    22:22   0:00 sshd: yansiyu@pts/1
yansiyu   5353  0.0  0.1 115548  2000 pts/0    Ss   22:21   0:00 -bash
www       2229  0.0  2.7 232096 27768 ?        S    15:54   0:02 php-fpm: pool www
www       1305  0.0  0.3 194732  3568 ?        S    15:53   0:00 nginx: cache manager process
www       1304  0.0  2.6 216072 27320 ?        S    15:53   0:00 nginx: worker process
www       1296  0.0  1.7 227580 18092 ?        S    15:53   0:02 php-fpm: pool www
www       1295  0.0  2.8 232784 28636 ?        S    15:53   0:02 php-fpm: pool www

查看内存占用最高的进程

ps aux|head -1;ps aux|grep -v PID|sort -rn -k +4|head
[root@iZbp1fna7ky0qz2jbj7gfpZ wwwlogs]# ps aux|head -1;ps aux|grep -v PID|sort -rn -k +4|head
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
mysql     2059  0.0 27.2 922080 276796 ?       Sl   15:54   0:12 /www/server/mysql/bin/mysqld --basedir=/www/server/mysql --datadir=/www/server/data --plugin-dir=/www/server/mysql/lib/plugin --user=mysql --sql-mode=NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION --log-error=iZbp1fna7ky0qz2jbj7gfpZ.err --open-files-limit=65535 --pid-file=/www/server/data/iZbp1fna7ky0qz2jbj7gfpZ.pid --socket=/tmp/mysql.sock --port=3306
root      1614  0.0  5.1 406760 51752 ?        Sl   15:54   0:04 /www/server/panel/pyenv/bin/python /www/server/panel/BT-Panel
root      1476  0.0  3.3 868820 34084 ?        Sl   15:53   0:18 /www/server/panel/pyenv/bin/python /www/server/panel/BT-Task
root       566  0.0  3.2 363100 32484 ?        Ssl  15:53   0:01 /usr/bin/python2 -Es /usr/sbin/firewalld --nofork --nopid
www       1295  0.0  2.8 232784 28636 ?        S    15:53   0:02 php-fpm: pool www
www       2229  0.0  2.7 232096 27768 ?        S    15:54   0:02 php-fpm: pool www
www       1304  0.0  2.6 216072 27320 ?        S    15:53   0:00 nginx: worker process
www       1294  0.0  2.5 229660 25696 ?        S    15:53   0:02 php-fpm: pool www
www       1292  0.0  2.2 227656 22908 ?        S    15:53   0:02 php-fpm: pool www
www       1293  0.0  1.9 229496 19736 ?        S    15:53   0:02 php-fpm: pool www

如有问题,可以QQ搜索群1028468525加入群聊,欢迎一起研究技术

支付宝 微信

有疑问联系站长,请联系QQ:QQ咨询

转载请注明:linux查看占用cpu高的进程 出自老鄢博客 | 欢迎分享