From: Bill Stoddard Date: Fri, 30 Aug 2002 16:12:59 +0000 (+0000) Subject: Win32: First cut as cleaning up mpm_default.h defaults X-Git-Tag: AGB_BEFORE_AAA_CHANGES~110 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=83ebce5bc5f9eed8d3050cbcbcecc11c72839131;p=apache Win32: First cut as cleaning up mpm_default.h defaults git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@96589 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/mpm/winnt/mpm_default.h b/server/mpm/winnt/mpm_default.h index 4ae413b914..5275af020d 100644 --- a/server/mpm/winnt/mpm_default.h +++ b/server/mpm/winnt/mpm_default.h @@ -59,26 +59,35 @@ #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 */ diff --git a/server/mpm/winnt/mpm_winnt.c b/server/mpm/winnt/mpm_winnt.c index df94fe2606..6db4f8c41e 100644 --- a/server/mpm/winnt/mpm_winnt.c +++ b/server/mpm/winnt/mpm_winnt.c @@ -81,36 +81,6 @@ #include #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;