查看 php-fpm 内存占用命令

栏目: 编程语言 · PHP · 发布时间: 8年前

内容简介:查看 php-fpm 内存占用命令

查看PHP-FPM内存占用的几个有用小命令,记录如下:

 

1.查看每个FPM的内存占用:

ps -ylC php-fpm --sort:rss

当然,在后后面加 | wc -l可查看系统当前FPM总进程数

单个进程占用23M内存大小;

# ps -ylC php-fpm --sort:rss

S   UID   PID  PPID  C PRI  NI   RSS    SZ WCHAN  TTY          TIME CMD

S     0   627     1  0  80   0   848  6205 ep_pol ?        00:01:09 php-fpm

S   501  6685   627  0  80   0 23392 10858 skb_re ?        00:01:21 php-fpm

S   501  6684   627  0  80   0 23536 10808 skb_re ?        00:01:17 php-fpm

S   501  6915   627  0  80   0 24752 10911 skb_re ?        00:01:12 php-fpm

# ps -ylC php-fpm --sort:rss|wc -l

5

 

2.查看PHP-FPM在你的机器上的平均内存占用:

命令如下:

ps --no-headers -o "rss,cmd" -C php-fpm | awk '{ sum+=$1 } END { printf ("%d%s\n", sum/NR/1024,"M") }'

 

平均内存为17M大小;

# ps --no-headers -o "rss,cmd" -C php-fpm | awk '{ sum+=$1 } END { printf ("%d%s\n", sum/NR/1024,"M") }'

17M

 

查看 80 端口 链接数量;

# netstat -ant |grep 80 |wc -l

101


以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Cracking the Coding Interview

Cracking the Coding Interview

Gayle Laakmann McDowell / CareerCup / 2015-7-1 / USD 39.95

Cracking the Coding Interview, 6th Edition is here to help you through this process, teaching you what you need to know and enabling you to perform at your very best. I've coached and interviewed hund......一起来看看 《Cracking the Coding Interview》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具

Markdown 在线编辑器
Markdown 在线编辑器

Markdown 在线编辑器