svn: /php/php-src/branches/PHP_5_3_FPM/sapi/fpm/fpm/ fpm_process_ctl.c
| From: | Jérôme Loyet | Date: | Sat, 19 Dec 2009 15:24:09 +0000 |
| Subject: | svn: /php/php-src/branches/PHP_5_3_FPM/sapi/fpm/fpm/ fpm_process_ctl.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-61355@lists.php.net to get a copy of this message | ||
fat Sat, 19 Dec 2009 15:24:09 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=292329
Log:
fix dynamic process manager (max_children limit could be ignored)
Changed paths:
U php/php-src/branches/PHP_5_3_FPM/sapi/fpm/fpm/fpm_process_ctl.c
Modified: php/php-src/branches/PHP_5_3_FPM/sapi/fpm/fpm/fpm_process_ctl.c
===================================================================
--- php/php-src/branches/PHP_5_3_FPM/sapi/fpm/fpm/fpm_process_ctl.c 2009-12-19 12:12:04 UTC (rev
292328)
+++ php/php-src/branches/PHP_5_3_FPM/sapi/fpm/fpm/fpm_process_ctl.c 2009-12-19 15:24:09 UTC (rev
292329)
@@ -363,13 +363,26 @@
wp->idle_spawn_rate = 1;
continue;
}
- wp->warn_max_children = 0;
if (wp->idle_spawn_rate >= 8) {
zlog(ZLOG_STUFF, ZLOG_WARNING, "[pool %s] seems busy (you may need to increase
start_servers, or min/max_spare_servers), spawning %d children, there are %d idle, and %d total
children", wp->config->name, wp->idle_spawn_rate, idle, wp->running_children);
}
+ /* compute the number of idle process to spawn */
i = MIN(wp->idle_spawn_rate, wp->config->pm->dynamic.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) {
+ 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;
+ }
+ wp->idle_spawn_rate = 1;
+ continue;
+ }
+ wp->warn_max_children = 0;
+
fpm_children_make(wp, 1, i, 1);
/* if it's a child, stop here without creating the next event