前端之家收集整理的这篇文章主要介绍了
Linux平台PHP5.4设置FPM线程数量的方法,
前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
@H_403_0@本文实例讲述了Linux平台PHP5.4设置FPM线程数量的方法。分享给大家供大家参考,具体如下:
@H_
403_0@
PHP5.4安装完毕后,FPM的默认
配置文件位于/usr/local/
PHP/etc/
PHP-fpm.conf.default
<div class="jb51code">
<pre class="brush:bash;">
cp /usr/local/PHP/etc/PHP-fpm.conf.default /usr/local/PHP/etc/PHP-fpm.conf
vim /usr/local/PHP/etc/PHP-fpm.conf
PHP_FCGI_CHILDREN environment variable in the original
PHP
; CGI. The below defaults are based on a server without much resources. Don't
; forget to tweak pm.* to fit your needs.
; Note: Used when pm is set to 'static','dynamic' or 'ondemand'
; Note: This value is mandatory.
pm.max_children = 5
; The number of child processes created on startup.
; Note: Used only when pm is set to 'dynamic'
; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2
pm.start_servers = 2
; The desired minimum number of idle server processes.
; Note: Used only when pm is set to 'dynamic'
; Note: Mandatory when pm is set to 'dynamic'
pm.min_spare_servers = 1
; The desired maximum number of idle server processes.
; Note: Used only when pm is set to 'dynamic'
; Note: Mandatory when pm is set to 'dynamic'
pm.max_spare_servers = 3
; The number of seconds after which an idle process will be killed.
; Note: Used only when pm is set to 'ondemand'
; Default Value: 10s
;pm.process_idle_timeout = 10s;
; The number of requests each child process should execute before respawning.
; This can be useful to work around memory leaks in 3rd party libraries. For
; endless request processing specify '0'. Equivalent to
PHP_FCGI_MAX_REQUESTS.
; Default Value: 0
;pm.max_requests = 500
_0@pm = dynamic 如何控制子进程,选项有static和dynamic,默认采用dynamic;如果选择static,则由pm.max_children指定固定的子进程数。
@H_