下面4个参数的意思分别为:
pm.max_children:静态方式下开启的php-fpm进程数量。
pm.start_servers:动态方式下的起始php-fpm进程数量。
pm.min_spare_servers:动态方式下的最小php-fpm进程数量。
pm.max_spare_servers:动态方式下的最大php-fpm进程数量。
注:以内存512M的VPS来说,建议设置的参数如下,仅供参考:
pm=dynamic
pm.max_children=20
pm.start_servers=5
pm.min_spare_servers=5
pm.max_spare_servers=20
更详细的优化设置
When you running a highload website with PHP-FPM via FastCGI, the following tips may be useful to you : )
如果您高负载网站使用PHP-FPM管理FastCGI,这些技巧也许对您有用:)
1. Compile PHP’s modules as less as possible, the simple the best (fast);
1.尽量少安装PHP模块,最简单是最好(快)的
2. Increas PHP FastCGI child number to 100 and even more. Sometime, 200 is OK! ( On 4GB memory server);
2.把您的PHP FastCGI子进程数调到100或以上,在4G内存的服务器上200就可以
注:我的1g测试机,开64个是最好的,建议使用压力测试获取最佳值
3. Using SOCKET PHP FastCGI, and put into /dev/shm on Linux;
3.使用socket连接FastCGI,linux操作系统可以放在 /dev/shm中
注:在php-fpm.cnf里设置
代码如下 | 复制代码 |
location ~ .*.(php|php5)?$ |
4. Increase Linux “max open files”, using the following command (must be root):
代码如下 | 复制代码 |
# echo ‘ulimit -HSn 65536′ >> /etc/profile |
4.调高linux内核打开文件数量,可以使用这些命令(必须是root帐号)
代码如下 | 复制代码 |
echo ‘ulimit -HSn 65536′ >> /etc/profile |
注:我是修改/etc/rc.local,加入ulimit -SHn 51200的
5. Increase PHP-FPM open file description rlimit:
代码如下 | 复制代码 |
# vi /path/to/php-fpm.conf |
5. 增加 PHP-FPM 打开文件描述符的限制:
代码如下 | 复制代码 |
# vi /path/to/php-fpm.conf |
找到“
把1024 更改为 4096 或者更高.
重启 PHP-FPM.
6. Using PHP code accelerator, e.g eAccelerator, XCache. And set “cache_dir” to /dev/shm on Linux.
6.使用php代码加速器,例如 eAccelerator, XCache.在linux平台上可以把`cache_dir`指向 /dev/shm
一个外国网站建议的办法
When you running a highload website with PHP-FPM via FastCGI, the following tips may be useful to you : )
如果您高负载网站使用PHP-FPM管 理FastCGI,这些技巧也许对您有用:)
1. Compile PHP’s modules as less as possible, the simple the best (fast);
1.尽量少安装PHP模块,最简单是最好(快)的 www.111cn.Net
2. Increas PHP FastCGI child number to 100 and even more. Sometime, 200 is OK! ( On 4GB memory server);
2.把您的PHP FastCGI子进程数调到100或以上,在4G内存的服务器上200就可以
注:我的1g测试机,开64个是最好的,建议使用压力测试获取最佳值
3. Using SOCKET PHP FastCGI, and put into /dev/shm on Linux;
3.使用socket连接FastCGI,linux操作系统可以放在 /dev/shm中
注: 在php-fpm.cnf 里设置/tmp/nginx.socket就可以通过socket连接 FastCGI了,/dev/shm是内存文件系统,放在内存中肯定会快了
4. Increase Linux “max open files”, using the following command (must be root):
代码如下 | 复制代码 |
# echo ‘ulimit -HSn 65536′ >> /etc/profile # echo ‘ulimit -HSn 65536 >> /etc/rc.local # source /etc/profile |
4.调高linux内核打开文件数量,可以使用这些命令(必须是root帐号)
代码如下 | 复制代码 |
echo ‘ulimit -HSn 65536′ >> /etc/profile echo ‘ulimit -HSn 65536′ >> /etc/rc.local source /etc/profile |
注:我是修改/etc/rc.local,加入ulimit -SHn 51200的
5. Increase PHP-FPM open file description rlimit:
代码如下 | 复制代码 |
# vi /path/to/php-fpm.conf Find “1024” Change 1024 to 4096 or higher number. Restart PHP-FPM. |
5. 增加 PHP-FPM 打开文件描述符的限制:
代码如下 | 复制代码 |
# vi /path/to/php-fpm.conf |
找到“1024”
把1024 更改为 4096 或者更高.
重启 PHP-FPM.
6. Using PHP code accelerator, e.g eAccelerator, XCache. And set “cache_dir” to /dev/shm on Linux.
6.使用php代码加速器,例如 eAccelerator, XCache.在linux平台上可以把`cache_dir`指向 /dev/shm
荒野乱斗国际版 (BrawlStars)最新版本v56.274
下载一波超人内置修改器菜单版 安卓版v1.0.2
下载敢达决战官方正版 安卓版v6.7.9
下载敢达决战 安卓版v6.7.9
下载继承了一座戏园子无限声望铜钱版 内置菜单最新版v1.7
继承了一座戏园子折相思版是游戏的破解版本,在该版本中为玩家提
山河半世橙光清软金手指版 无限鲜花v3.24
山河半世是一款超级好玩的橙光恋爱游戏,在游戏中玩家们需要扮演
蓬莱手游折相思版 安卓版v1.0.0
蓬莱免广告版是游戏的修改版本,在该版本中为玩家去除了广告,玩
当红影后橙光游戏破解版2025 最新版v1.0
当红影后橙光破解版是一款超级好玩的娱乐圈题材的橙光游戏,在这
忽然成了万人迷清软完结版 无限鲜花版v12.15
忽然成了万人迷破解版是一款非常好玩的男性向橙光游戏,在有一天