]> granicus.if.org Git - apache/commitdiff
Win32: First cut as cleaning up mpm_default.h defaults
authorBill Stoddard <stoddard@apache.org>
Fri, 30 Aug 2002 16:12:59 +0000 (16:12 +0000)
committerBill Stoddard <stoddard@apache.org>
Fri, 30 Aug 2002 16:12:59 +0000 (16:12 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@96589 13f79535-47bb-0310-9956-ffa450edef68

server/mpm/winnt/mpm_default.h
server/mpm/winnt/mpm_winnt.c

index 4ae413b914f6557d8a44b6c2150f73c0e3d74d26..5275af020de20d2c52773f17584440022a45b0e5 100644 (file)
 #ifndef APACHE_MPM_DEFAULT_H
 #define APACHE_MPM_DEFAULT_H
 
-/* Number of threads to spawn off by default --- also, if fewer than
- * this free when the caretaker checks, it will spawn more.
+/* Default limit on the maximum setting of the ThreadsPerChild configuration
+ * directive.  This limit can be overridden with the ThreadLimit directive.
+ * This limit directly influences the amount of shared storage that is allocated
+ * for the scoreboard. DEFAULT_THREAD_LIMIT represents a good compromise
+ * between scoreboard size and the ability of the server to handle the most
+ * common installation requirements.
  */
-#ifndef DEFAULT_START_THREAD
-#define DEFAULT_START_THREAD 5
+#ifndef DEFAULT_THREAD_LIMIT
+#define DEFAULT_THREAD_LIMIT 1920
 #endif
 
-/* Maximum number of *free* server threads --- more than this, and
- * they will die off.
-#ifndef DEFAULT_MAX_SPARE_THREAD
-#define DEFAULT_MAX_SPARE_THREAD 10
+/* The ThreadLimit directive can be used to override the DEFAULT_THREAD_LIMIT.
+ * ThreadLimit cannot be tuned larger than MAX_THREAD_LIMIT.
+ * This is a sort of compile-time limit to help catch typos.
+ */
+#ifndef MAX_THREAD_LIMIT
+#define MAX_THREAD_LIMIT 15000
 #endif
-*/
 
-/* Minimum --- fewer than this, and more will be created */
-/*
-#ifndef DEFAULT_MIN_SPARE_THREAD
-#define DEFAULT_MIN_SPARE_THREAD 5
+/* Number of threads started in the child process in the absence
+ * of a ThreadsPerChild configuration directive
+ */
+#ifndef DEFAULT_THREADS_PER_CHILD
+#define DEFAULT_THREADS_PER_CHILD 64
 #endif
-*/
+
+/* Max number of child processes allowed.
+ */
+#define HARD_SERVER_LIMIT 1
 
 /* Number of servers to spawn off by default
  */
index df94fe2606b732a8386907caad22c558ba5fcd15..6db4f8c41e9d926ecffd6001ab190e580bee753a 100644 (file)
 #include <malloc.h>
 #include "apr_atomic.h"
 
-/* Limit on the threads per process.  Clients will be locked out if more than
- * this  * server_limit are needed.
- *
- * We keep this for one reason it keeps the size of the scoreboard file small
- * enough that we can read the whole thing without worrying too much about
- * the overhead.
- */
-#ifndef DEFAULT_THREAD_LIMIT
-#define DEFAULT_THREAD_LIMIT 1920
-#endif
-
-/* Admin can't tune ThreadLimit beyond MAX_THREAD_LIMIT.  We want
- * some sort of compile-time limit to help catch typos.
- */
-#ifndef MAX_THREAD_LIMIT
-#define MAX_THREAD_LIMIT 15000
-#endif
-
-/* Limit on the total --- clients will be locked out if more servers than
- * this are needed.  It is intended solely to keep the server from crashing
- * when things get out of hand.
- *
- * We keep a hard maximum number of servers, for two reasons --- first off,
- * in case something goes seriously wrong, we want to stop the fork bomb
- * short of actually crashing the machine we're running on by filling some
- * kernel table.  Secondly, it keeps the size of the scoreboard file small
- * enough that we can read the whole thing without worrying too much about
- * the overhead.
- */
-#define HARD_SERVER_LIMIT 1
 
 /* scoreboard.c does the heavy lifting; all we do is create the child
  * score by moving a handle down the pipe into the child's stdin.
@@ -1413,7 +1383,7 @@ static int winnt_pre_config(apr_pool_t *pconf_, apr_pool_t *plog, apr_pool_t *pt
     }
 
     ap_listen_pre_config();
-    ap_threads_per_child = DEFAULT_START_THREAD;
+    ap_threads_per_child = DEFAULT_THREADS_PER_CHILD;
     ap_pid_fname = DEFAULT_PIDLOG;
     ap_max_requests_per_child = DEFAULT_MAX_REQUESTS_PER_CHILD;