簡體   English   中英

什么是PHP-FPM池,什么是pm.max_children?

[英]What are PHP-FPM pools and what is pm.max_children?

我有一個帶有3個池的NGINX和PHP-FPM的Drupal網站。

我想知道什么是FPM池,或者只是給我提供了良好文檔的鏈接,我已經搜索了有關此主題的信息,但是我發現的全部是如何配置“ X”以獲得更好的性能。

另外,pm.max_children是什么? 我最近在日志中注意到,當池www1達到此值時,池www1停止工作,並在我的站點上也鎖定了一個頁面,直到重新加載PHP-FPM。 為什么一段時間后我到達pm.max_children? 有沒有一種方法可以在這種情況下檢測並做出反應...重新加載PHP-FPM? 有沒有辦法避免到達pm.max_children?

謝謝大家的知識。

PD:我正在使用perusio的Drupal和Nginx的配置。

好吧,您可以簡單地說每個池就像一個單獨的php,對我來說,我使用池來由不同的用戶運行每個池,在資源方面給每個池適當的限制,例如在同一服務器上運行的各個網站。

我不明白為什么同一個站點有3個池,您在nginx中使用upstream嗎?

至於max_children是允許fpm生成以處理並發連接的已生成進程的數量,如果您有很多並發連接,則最好增加該數量,如果達到該數量,則fpm不會生成另一個子並等待一個可以自由處理等待的請求。

編輯

嘗試使用此配置,可能會很有用,這是配置文件的一部分,默認情況下帶有注釋。

; 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

這也是另一個

; The timeout for serving a single request after which the worker process will
; be killed. This option should be used when the 'max_execution_time' ini option
; does not stop script execution for some reason. A value of '0' means 'off'.
; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
; Default Value: 0
;request_terminate_timeout = 0

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM