我正试图调优我的服务器的php安装,我很难弄清楚如何处理pm.start_servers、pm.min_spare_servers和pm.max_spare_servers变量。我正在使用pm = dynamic
pm.max_children是非常清楚的。每个子进程一次为一个web客户端服务。好的。那么什么是“服务器”呢?显然,根据我的默认配置,1台服务器可以为多个子服务器提供服务。上限是多少?对于#的子/服务器,我应该使用什么作为经验规则?或者这有关系吗?在一些论坛上,有人声称#的服务器应该是2x#的cpu核心,但我已经看到了建议的配置,那里的数目要高得多,40-50。
PHP文档和许多“调优php”文章都没有任何帮助。
发布于 2017-02-16 04:50:45
基本上,php在任何时候运行的进程数在设置为dynamic时都是非常可配置的,就像您所做的那样。当设置为static时,总是会有许多子进程在运行。通常,您可以将其设置为动态,以节省资源。每个子进程可以处理一个请求。上限取决于您的php应用程序有多重,以及您得到了多少流量。您还应该计算每个子程序的平均内存消耗,并确保不允许在服务器上安装的子内存数量超过内存数量,否则将开始交换,甚至让内核开始杀死进程。
; Choose how the process manager will control the number of child processes.
; Possible Values:
; static - a fixed number (pm.max_children) of child processes;
; dynamic - the number of child processes are set dynamically based on the
; following directives:
; pm.max_children - the maximum number of children that can
; be alive at the same time.
; pm.start_servers - the number of children created on startup.
; pm.min_spare_servers - the minimum number of children in 'idle'
; state (waiting to process). If the number
; of 'idle' processes is less than this
; number then some children will be created.
; pm.max_spare_servers - the maximum number of children in 'idle'
; state (waiting to process). If the number
; of 'idle' processes is greater than this
; number then some children will be killed.
; Note: This value is mandatory.在设置这些选项时,请考虑以下几点:
https://serverfault.com/questions/832832
复制相似问题