查看每个php-fpm平均占用系统内存,也适用看nginx/mysqld等,把php-fpm换成mysqld
ps --no-headers -o "rss,cmd" -C php-fpm | awk '{ sum+=$1 } END { printf ("%d%s\n", sum/NR/1024,"M") }'
查看占用内存
[root@centos69 ~]# ps -ylC php-fpm --sort:rss
S UID PID PPID C PRI NI RSS SZ WCHAN TTY TIME CMD
S 0 3082 1 0 80 0 6124 53280 ep_pol ? 00:00:00 php-fpm
R 500 3085 3082 9 80 0 25708 57731 - ? 00:03:00 php-fpm
R 500 3086 3082 9 80 0 25712 57731 - ? 00:03:00 php-fpm
R 500 3083 3082 9 80 0 25716 57734 - ? 00:03:00 php-fpm
R 500 3087 3082 9 80 0 25720 57741 - ? 00:03:00 php-fpm
R 500 3088 3082 9 80 0 25732 57738 - ? 00:02:59 php-fpm
R 500 3090 3082 9 80 0 25732 57735 - ? 00:02:59 php-fpm
R 500 3094 3082 9 80 0 25756 57764 - ? 00:02:59 php-fpm
R 500 3084 3082 9 80 0 25808 57764 - ? 00:03:00 php-fpm
R 500 3092 3082 9 80 0 25828 57761 - ? 00:02:59 php-fpm
R 500 3096 3082 9 80 0 25856 57768 - ? 00:02:59 php-fpm
转载于:https://blog.51cto.com/sadoc/1932500