最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Linux平臺PHP5.4設置FPM線程數(shù)量的方法

 更新時間:2016年11月09日 15:24:39   作者:單曲.碼農的生活  
這篇文章主要介紹了Linux平臺PHP5.4設置FPM線程數(shù)量的方法,較為詳細的分析了Linux平臺php5.4設置FPM的相關參數(shù)、功能及使用技巧,需要的朋友可以參考下

本文實例講述了Linux平臺PHP5.4設置FPM線程數(shù)量的方法。分享給大家供大家參考,具體如下:

PHP5.4安裝完畢后,F(xiàn)PM的默認配置文件位于/usr/local/php/etc/php-fpm.conf.default

>cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf
>vim /usr/local/php/etc/php-fpm.conf

輸入”/www”,搜索www所在的POOL

pm = dynamic
; The number of child processes to be created when pm is set to 'static' and the
; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'.
; This value sets the limit on the number of simultaneous requests that will be
; served. Equivalent to the ApacheMaxClients directive with mpm_prefork.
; Equivalent to the 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

解釋一下:

pm = dynamic 如何控制子進程,選項有static和dynamic,默認采用dynamic;如果選擇static,則由pm.max_children指定固定的子進程數(shù)。

如果選擇dynamic,則由以下參數(shù)決定:

pm.max_children 子進程最大數(shù)
pm.start_servers 啟動時的進程數(shù)
pm.min_spare_servers 保證空閑進程數(shù)最小值,如果空閑進程小于此值,則創(chuàng)建新的子進程
pm.max_spare_servers 保證空閑進程數(shù)最大值,如果空閑進程大于此值,則進行清理。對于專用服務器,pm可以設置為static。
pm.max_requests 設置每個子進程重生之前服務的請求數(shù). 對于可能存在內存泄漏的第三方模塊來說是非常有用的. 如果設置為 '0′ 則一直接受請求. 設置為500就可以了(默認0)。

將值修改為如下:

pm.max_children = 32
pm.start_servers = 16
pm.min_spare_servers = 8
pm.max_spare_servers = 32
pm.max_requests = 500

:wq 保存退出VIM

>/usr/local/php/sbin/php-fpm -t
NOTICE: configuration file /usr/local/php/etc/php-fpm.conf test is successful

測試配置文件是否正常,沒問題,殺掉當前的FPM進程

>/usr/local/php/sbin/php-fpm

啟動

更多關于PHP相關內容感興趣的讀者可查看本站專題:《php程序設計安全教程》、《php面向對象程序設計入門教程》、《PHP數(shù)學運算技巧總結》、《PHP數(shù)組(Array)操作技巧大全》、《php字符串(string)用法總結》、《PHP數(shù)據(jù)結構與算法教程》、《php程序設計算法總結》及《php常見數(shù)據(jù)庫操作技巧匯總

希望本文所述對大家PHP程序設計有所幫助。

相關文章

最新評論

安阳县| 霍林郭勒市| 射洪县| 延边| 闽清县| 平谷区| 积石山| 德惠市| 霍山县| 利川市| 韶关市| 无锡市| 淮北市| 罗源县| 德昌县| 尚志市| 昌乐县| 宜兰县| 聂拉木县| 稻城县| 攀枝花市| 陆川县| 会泽县| 延安市| 莱州市| 察哈| 梁河县| 兴文县| 周至县| 铁岭市| 荥阳市| 扶沟县| 蒙自县| 泸定县| 阜城县| 孟连| 涟水县| 鄂尔多斯市| 嵊泗县| 承德县| 黄山市|