centos7下的php-fpm的优化
星期四, 2019-10-03 | Author: Lee | linux, php | 2,228 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
文章作者: Lee
本文地址: https://www.pomelolee.com/1928.html
除非注明,Pomelo Lee文章均为原创,转载请以链接形式标明本文地址
No comments yet.
Leave a comment
Search
相关文章
热门文章
最新文章
文章分类
- ajax (10)
- algorithm-learn (3)
- Android (6)
- as (3)
- computer (85)
- Database (30)
- disucz (4)
- enterprise (1)
- erlang (2)
- flash (5)
- golang (3)
- html5 (18)
- ios (4)
- JAVA-and-J2EE (186)
- linux (143)
- mac (10)
- movie-music (11)
- pagemaker (36)
- php (50)
- spring-boot (2)
- Synology群晖 (2)
- Uncategorized (6)
- unity (1)
- webgame (15)
- wordpress (33)
- work-other (2)
- 低代码 (1)
- 体味生活 (40)
- 前端 (21)
- 大数据 (8)
- 游戏开发 (9)
- 爱上海 (19)
- 读书 (4)
- 软件 (3)