From a7057e4e49729f65f1ff3a0bd926d5c1bb9fa7bb Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Loyet?= Date: Mon, 30 Aug 2010 15:21:31 +0000 Subject: [PATCH] - only one process (for all pools) could be killed by the 'dynamic' process manager. Now it's one process per pool which can be killed by the 'dynamic' process manager. - rename nonsense variable (i) --- sapi/fpm/fpm/fpm_process_ctl.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sapi/fpm/fpm/fpm_process_ctl.c b/sapi/fpm/fpm/fpm_process_ctl.c index b24f950f57..573a596a35 100644 --- a/sapi/fpm/fpm/fpm_process_ctl.c +++ b/sapi/fpm/fpm/fpm_process_ctl.c @@ -317,13 +317,13 @@ static void fpm_pctl_check_request_timeout(struct timeval *now) /* {{{ */ static void fpm_pctl_perform_idle_server_maintenance(struct timeval *now, struct event_base *base) /* {{{ */ { struct fpm_worker_pool_s *wp; - struct fpm_child_s *last_idle_child = NULL; - int i; for (wp = fpm_worker_all_pools; wp; wp = wp->next) { struct fpm_child_s *child; + struct fpm_child_s *last_idle_child = NULL; int idle = 0; int active = 0; + int children_to_fork; if (wp->config == NULL) continue; @@ -378,11 +378,11 @@ static void fpm_pctl_perform_idle_server_maintenance(struct timeval *now, struct } /* compute the number of idle process to spawn */ - i = MIN(wp->idle_spawn_rate, wp->config->pm_min_spare_servers - idle); + children_to_fork = MIN(wp->idle_spawn_rate, wp->config->pm_min_spare_servers - idle); /* get sure it won't exceed max_children */ - i = MIN(i, wp->config->pm_max_children - wp->running_children); - if (i <= 0) { + children_to_fork = MIN(children_to_fork, wp->config->pm_max_children - wp->running_children); + if (children_to_fork <= 0) { if (!wp->warn_max_children) { zlog(ZLOG_STUFF, ZLOG_WARNING, "[pool %s] server reached max_children setting (%d), consider raising it", wp->config->name, wp->config->pm_max_children); wp->warn_max_children = 1; @@ -392,7 +392,7 @@ static void fpm_pctl_perform_idle_server_maintenance(struct timeval *now, struct } wp->warn_max_children = 0; - fpm_children_make(wp, 1, i, 1, base); + fpm_children_make(wp, 1, children_to_fork, 1, base); /* if it's a child, stop here without creating the next event * this event is reserved to the master process @@ -401,7 +401,7 @@ static void fpm_pctl_perform_idle_server_maintenance(struct timeval *now, struct return; } - zlog(ZLOG_STUFF, ZLOG_DEBUG, "[pool %s] %d child(ren) have been created dynamically", wp->config->name, i); + zlog(ZLOG_STUFF, ZLOG_DEBUG, "[pool %s] %d child(ren) have been created dynamically", wp->config->name, children_to_fork); /* Double the spawn rate for the next iteration */ if (wp->idle_spawn_rate < FPM_MAX_SPAWN_RATE) { -- 2.40.0