Skip to content

Commit 37a878b

Browse files
committed
FPM: Prevent warning with raising pm.max_children for shared pool
1 parent a359635 commit 37a878b

File tree

3 files changed

+5
-13
lines changed

3 files changed

+5
-13
lines changed

sapi/fpm/fpm/fpm_conf.c

-2
Original file line numberDiff line numberDiff line change
@@ -725,8 +725,6 @@ static int fpm_worker_pool_shared_status_alloc(struct fpm_worker_pool_s *shared_
725725

726726
config->pm = PM_STYLE_ONDEMAND;
727727
config->pm_max_children = 2;
728-
/* set to 1 to not warn about max children for shared pool */
729-
shared_wp->warn_max_children = 1;
730728

731729
current_wp->shared = shared_wp;
732730

sapi/fpm/fpm/fpm_process_ctl.c

+5-9
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ static void fpm_pctl_perform_idle_server_maintenance(struct timeval *now) /* {{{
390390

391391
if (idle < wp->config->pm_min_spare_servers) {
392392
if (wp->running_children >= wp->config->pm_max_children) {
393-
if (!wp->warn_max_children) {
393+
if (!wp->warn_max_children && !wp->shared) {
394394
fpm_scoreboard_update(0, 0, 0, 0, 0, 1, 0, FPM_SCOREBOARD_ACTION_INC, wp->scoreboard);
395395
zlog(ZLOG_WARNING, "[pool %s] server reached pm.max_children setting (%d), consider raising it", wp->config->name, wp->config->pm_max_children);
396396
wp->warn_max_children = 1;
@@ -409,17 +409,15 @@ static void fpm_pctl_perform_idle_server_maintenance(struct timeval *now) /* {{{
409409
/* get sure it won't exceed max_children */
410410
children_to_fork = MIN(children_to_fork, wp->config->pm_max_children - wp->running_children);
411411
if (children_to_fork <= 0) {
412-
if (!wp->warn_max_children) {
412+
if (!wp->warn_max_children && !wp->shared) {
413413
fpm_scoreboard_update(0, 0, 0, 0, 0, 1, 0, FPM_SCOREBOARD_ACTION_INC, wp->scoreboard);
414414
zlog(ZLOG_WARNING, "[pool %s] server reached pm.max_children setting (%d), consider raising it", wp->config->name, wp->config->pm_max_children);
415415
wp->warn_max_children = 1;
416416
}
417417
wp->idle_spawn_rate = 1;
418418
continue;
419419
}
420-
if (!wp->shared) {
421-
wp->warn_max_children = 0;
422-
}
420+
wp->warn_max_children = 0;
423421

424422
fpm_children_make(wp, 1, children_to_fork, 1);
425423

@@ -515,7 +513,7 @@ void fpm_pctl_on_socket_accept(struct fpm_event_s *ev, short which, void *arg) /
515513
/* zlog(ZLOG_DEBUG, "[pool %s] heartbeat running_children=%d", wp->config->name, wp->running_children);*/
516514

517515
if (wp->running_children >= wp->config->pm_max_children) {
518-
if (!wp->warn_max_children) {
516+
if (!wp->warn_max_children && !wp->shared) {
519517
fpm_scoreboard_update(0, 0, 0, 0, 0, 1, 0, FPM_SCOREBOARD_ACTION_INC, wp->scoreboard);
520518
zlog(ZLOG_WARNING, "[pool %s] server reached max_children setting (%d), consider raising it", wp->config->name, wp->config->pm_max_children);
521519
wp->warn_max_children = 1;
@@ -530,9 +528,7 @@ void fpm_pctl_on_socket_accept(struct fpm_event_s *ev, short which, void *arg) /
530528
return;
531529
}
532530
}
533-
if (!wp->shared) {
534-
wp->warn_max_children = 0;
535-
}
531+
wp->warn_max_children = 0;
536532
fpm_children_make(wp, 1, 1, 1);
537533

538534
if (fpm_globals.is_child) {

sapi/fpm/tests/status-listen.phpt

-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
FPM: Status listen test
33
--SKIPIF--
44
<?php include "skipif.inc"; ?>
5-
--XFAIL--
6-
Flaky test
75
--FILE--
86
<?php
97

0 commit comments

Comments
 (0)