8

CentOS linux+nginx+php 性能调优 - 包子啥汤

 3 years ago
source link: https://www.deaboway.com/centos-linuxnginxphp-%e6%80%a7%e8%83%bd%e8%b0%83%e4%bc%98.html#.X-EgOhMRWo8
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

包子啥汤

no Pain no Gain no Gavin

CentOS linux+nginx+php 性能调优

performance-tunning-SQL.jpg

1. 获取占用CPU资源最多的10个进程:

ps aux|head -1;ps aux|grep -v PID|sort -rn -k +3|head

2. 获取占用内存资源最多的10个进程:

ps aux|head -1;ps aux|grep -v PID|sort -rn -k +4|head 

3. 通过命令查看服务器上一共开了多少的 php-cgi 进程 

ps -fe |grep “php-fpm”|grep “pool”|wc -l

4. 查看已经有多少个php-cgi进程用来处理tcp请求 

netstat -anp|grep “php-fpm”|grep “tcp”|grep “pool”|wc -l

5. linux+nginx+php环境中,每个php-fpm进程的内存限制 设置方法:

编辑php-fpm.conf配置文件

php_admin_value[memory_limit] = 128M

(我服务器上的配置文件在/etc/opt/remi/php74/php-fpm.conf,包含/etc/opt/remi/php74/php-fpm.d/www.conf)

后边的数字可以随便更改:32M,64M,128M,256M,512M,

这个设置可根据你的服务器内存大小和你的需求来写

修改后要重启一下:

systemctl restart php74-php-fpm

欢迎关注我的微信公众号:

qrcwechat.jpg

如无特殊说明,文章均为本站原创,转载请注明出处!

e6578c0c30a337e335cd5d2dbc3f2836?s=49&d=monsterid&r=g作者 deaboway发布于 2020年8月6日2020年8月10日格式 日志分类 1. 全栈开发标签 performance tuning性能调优

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK