centos7下的php-fpm的优化

星期四, 2019-10-03 | Author: Lee | linux, php | 123 views

云主机只有1C1G的内存,既要运行wordpress还要运行一个java程序及mysql,内存实在吃紧,运行1天发现mysql内存不足被杀掉,随优化之。

1.优化mysql参数

[myisamchk]
key_buffer_size = 8M
sort_buffer_size = 8M
read_buffer = 4M
write_buffer = 4M

详情可以参考 https://www.pomelolee.com/1304.html

2.php-fpm优化,减少php-fpm的数量

配置文件地址:/etc/opt/remi/php70/php-fpm.conf

实际修改配置文件:/etc/opt/remi/php70/php-fpm.d/www.conf

systemctl stop php70-php-fpm.service

pm = dynamic
pm.start_servers = 2
pm.min_spare_servers = 2
pm.max_spare_servers = 5

systemctl restart php70-php-fpm.service

Tags: , ,

文章作者: Lee

本文地址: https://www.pomelolee.com/1928.html

除非注明,Pomelo Lee文章均为原创,转载请以链接形式标明本文地址

No comments yet.

Leave a comment

Search

文章分类

Meta