php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login

Patch max_total_processes-patch-V1-PHP-5.3-SVN-Branch for FPM related Bug #55166

Patch version 2011-07-09 16:09 UTC

Return to Bug #55166 | Download this patch
Patch Revisions:

Developer: trollofdarkness@gmail.com

diff -Naur php/sapi/fpm/fpm/fpm.c php_patched/sapi/fpm/fpm/fpm.c
--- php/sapi/fpm/fpm/fpm.c	2010-11-30 20:37:10.000000000 +0100
+++ php_patched/sapi/fpm/fpm/fpm.c	2011-02-12 21:58:19.000000000 +0100
@@ -75,7 +75,7 @@
 	}
 
 	fpm_stdio_init_final();
-	zlog(ZLOG_NOTICE, "fpm is running, pid %d", (int) fpm_globals.parent_pid);
+	zlog( ZLOG_NOTICE, "fpm is running, pid %d, with max_total_processes equal to %d", (int) fpm_globals.parent_pid, fpm_global_config.max_total_processes); // modif by patch max_total_processes
 
 	return 0;
 }
diff -Naur php/sapi/fpm/fpm/fpm_children.c php_patched/sapi/fpm/fpm/fpm_children.c
--- php/sapi/fpm/fpm/fpm_children.c	2010-11-26 14:46:15.000000000 +0100
+++ php_patched/sapi/fpm/fpm/fpm_children.c	2011-02-12 19:06:48.000000000 +0100
@@ -373,7 +373,7 @@
 		max = wp->config->pm_max_children;
 	}
 
-	while (fpm_pctl_can_spawn_children() && wp->running_children < max) {
+	while (fpm_pctl_can_spawn_children() && wp->running_children < max && fpm_globals.running_children < fpm_global_config.max_total_processes) { /* modif by patch max_total_processes */
 		child = fpm_resources_prepare(wp);
 
 		if (!child) {
diff -Naur php/sapi/fpm/fpm/fpm_conf.c fpm_conf.c.test
--- php/sapi/fpm/fpm/fpm_conf.c	2011-07-09 15:18:16.138610692 +0200
+++ fpm_conf.c.test	2011-07-09 15:49:05.545611106 +0200
@@ -74,6 +74,7 @@
 	{ "pid",                         &fpm_conf_set_string,      GO(pid_file) },
 	{ "error_log",                   &fpm_conf_set_string,      GO(error_log) },
 	{ "log_level",                   &fpm_conf_set_log_level,   0 },
+	{ "max_total_processes",		 &fpm_conf_set_integer, offsetof(struct fpm_global_config_s, max_total_processes) }, // added modif by patch max_total_processes	
 	{ "rlimit_files",                &fpm_conf_set_integer,     GO(rlimit_files) },
 	{ "rlimit_core",                 &fpm_conf_set_rlimit_core, GO(rlimit_core) },
 	{ 0, 0, 0 }
diff -Naur php/sapi/fpm/fpm/fpm_conf.h fpm_conf.h.test
--- php/sapi/fpm/fpm/fpm_conf.h	2011-07-09 15:18:16.140608892 +0200
+++ fpm_conf.h.test	2011-07-09 15:57:11.486611108 +0200
@@ -25,6 +25,7 @@
 	int daemonize;
 	char *pid_file;
 	char *error_log;
+	int max_total_processes; // added modif by patch max_total_processes
 	int rlimit_files;
 	int rlimit_core;
 };
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Thu Apr 24 19:01:53 2014 UTC