You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ji...@apache.org on 2016/02/18 13:06:39 UTC

svn commit: r1731052 - in /httpd/httpd/trunk/server/mpm/motorz: motorz.c mpm_default.h

Author: jim
Date: Thu Feb 18 12:06:39 2016
New Revision: 1731052

URL: http://svn.apache.org/viewvc?rev=1731052&view=rev
Log:
ensure sane defaults

Modified:
    httpd/httpd/trunk/server/mpm/motorz/motorz.c
    httpd/httpd/trunk/server/mpm/motorz/mpm_default.h

Modified: httpd/httpd/trunk/server/mpm/motorz/motorz.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/motorz/motorz.c?rev=1731052&r1=1731051&r2=1731052&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/motorz/motorz.c (original)
+++ httpd/httpd/trunk/server/mpm/motorz/motorz.c Thu Feb 18 12:06:39 2016
@@ -20,8 +20,8 @@
  * config globals
  */
 static motorz_core_t *g_motorz_core;
-static int threads_per_child = 0;
-static int ap_num_kids = 0;
+static int threads_per_child = 16;
+static int ap_num_kids = DEFAULT_START_DAEMON;
 static int mpm_state = AP_MPMQ_STARTING;
 
 /* one_process --- debugging mode variable; can be set from the command line
@@ -1675,21 +1675,21 @@ static int motorz_check_config(apr_pool_
         startup = 1;
     }
 
-    if (ap_num_kids > MAX_SERVER_LIMIT) {
+    if (ap_num_kids > DEFAULT_SERVER_LIMIT) {
         if (startup) {
             ap_log_error(APLOG_MARK, APLOG_WARNING | APLOG_STARTUP, 0, NULL, APLOGNO(02886)
                          "WARNING: StartServers of %d exceeds compile-time "
                          "limit of", ap_num_kids);
             ap_log_error(APLOG_MARK, APLOG_WARNING | APLOG_STARTUP, 0, NULL, APLOGNO(03118)
                          " %d servers, decreasing to %d.",
-                         MAX_SERVER_LIMIT, MAX_SERVER_LIMIT);
+                         DEFAULT_SERVER_LIMIT, DEFAULT_SERVER_LIMIT);
         } else {
             ap_log_error(APLOG_MARK, APLOG_WARNING, 0, s, APLOGNO(02887)
                          "StartServers of %d exceeds compile-time limit "
                          "of %d, decreasing to match",
-                         ap_num_kids, MAX_SERVER_LIMIT);
+                         ap_num_kids, DEFAULT_SERVER_LIMIT);
         }
-        ap_num_kids = MAX_SERVER_LIMIT;
+        ap_num_kids = DEFAULT_SERVER_LIMIT;
     }
     else if (ap_num_kids < 1) {
         if (startup) {
@@ -1704,6 +1704,34 @@ static int motorz_check_config(apr_pool_
         ap_num_kids = 1;
     }
 
+    if (threads_per_child > MAX_THREAD_LIMIT) {
+        if (startup) {
+            ap_log_error(APLOG_MARK, APLOG_WARNING | APLOG_STARTUP, 0, NULL, APLOGNO()
+                         "WARNING: ThreadsPerChild of %d exceeds compile-time "
+                         "limit of", threads_per_child);
+            ap_log_error(APLOG_MARK, APLOG_WARNING | APLOG_STARTUP, 0, NULL, APLOGNO()
+                         " %d servers, decreasing to %d.",
+                         MAX_THREAD_LIMIT, MAX_THREAD_LIMIT);
+        } else {
+            ap_log_error(APLOG_MARK, APLOG_WARNING, 0, s, APLOGNO()
+                         "ThreadsPerChild of %d exceeds compile-time limit "
+                         "of %d, decreasing to match",
+                         threads_per_child, MAX_THREAD_LIMIT);
+        }
+        threads_per_child = MAX_THREAD_LIMIT;
+    }
+    else if (threads_per_child < 1) {
+        if (startup) {
+            ap_log_error(APLOG_MARK, APLOG_WARNING | APLOG_STARTUP, 0, NULL, APLOGNO()
+                         "WARNING: ThreadsPerChild of %d not allowed, "
+                         "increasing to 1.", threads_per_child);
+        } else {
+            ap_log_error(APLOG_MARK, APLOG_WARNING, 0, s, APLOGNO()
+                         "ThreadsPerChild of %d not allowed, increasing to 1",
+                         threads_per_child);
+        }
+        threads_per_child = 1;
+    }
 
     return OK;
 }

Modified: httpd/httpd/trunk/server/mpm/motorz/mpm_default.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/motorz/mpm_default.h?rev=1731052&r1=1731051&r2=1731052&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/motorz/mpm_default.h (original)
+++ httpd/httpd/trunk/server/mpm/motorz/mpm_default.h Thu Feb 18 12:06:39 2016
@@ -29,21 +29,7 @@
 /* Number of servers to spawn off by default --- 
  */
 #ifndef DEFAULT_START_DAEMON
-#define DEFAULT_START_DAEMON 1
-#endif
-
-/* Maximum number of *free* server processes --- more than this, and
- * they will die off.
- */
-
-#ifndef DEFAULT_MAX_FREE_DAEMON
-#define DEFAULT_MAX_FREE_DAEMON 2
-#endif
-
-/* Minimum --- fewer than this, and more will be created */
-
-#ifndef DEFAULT_MIN_FREE_DAEMON
-#define DEFAULT_MIN_FREE_DAEMON 1
+#define DEFAULT_START_DAEMON 2
 #endif
 
 #endif /* AP_MPM_DEFAULT_H */