国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 語言 > PHP > 正文

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

2024-05-04 23:52:02
字體:
來源:轉載
供稿:網友

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

PHP5.4安裝完畢后,FPM的默認配置文件位于/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) / 2pm.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指定固定的子進程數。

如果選擇dynamic,則由以下參數決定:

 

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

 

將值修改為如下:

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

:wq 保存退出VIM

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

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

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

啟動

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


注:相關教程知識閱讀請移步到PHP教程頻道。
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表

圖片精選

主站蜘蛛池模板: 长沙市| 京山县| 威宁| 班玛县| 扶风县| 定兴县| 武强县| 榆林市| 鹿邑县| 石泉县| 阿鲁科尔沁旗| 定远县| 宜川县| 廊坊市| 白城市| 惠水县| 德江县| 三河市| 北碚区| 大田县| 清苑县| 寿光市| 闻喜县| 汶上县| 类乌齐县| 鹤峰县| 时尚| 肥西县| 中卫市| 孝感市| 利津县| 祁东县| 措美县| 收藏| 泸定县| 江永县| 波密县| 梨树县| 北海市| 凭祥市| 林州市|