]> granicus.if.org Git - apache/commitdiff
Move HARD_SERVER_LIMIT, HARD_THREAD_LIMIT, and other defines from
authorManoj Kasichainula <manoj@apache.org>
Fri, 16 Jul 1999 05:30:35 +0000 (05:30 +0000)
committerManoj Kasichainula <manoj@apache.org>
Fri, 16 Jul 1999 05:30:35 +0000 (05:30 +0000)
httpd.h that are really mpm-specific, and move them into a header file
in each MPM directory.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@83459 13f79535-47bb-0310-9956-ffa450edef68

server/mpm/mpmt_pthread/mpm_default.h [new file with mode: 0644]
server/mpm/mpmt_pthread/scoreboard.h
server/mpm/prefork/mpm_default.h [new file with mode: 0644]
server/mpm/prefork/prefork.c
server/mpm/spmt_os2/mpm_default.h [new file with mode: 0644]
server/mpm/spmt_os2/spmt_os2.c

diff --git a/server/mpm/mpmt_pthread/mpm_default.h b/server/mpm/mpmt_pthread/mpm_default.h
new file mode 100644 (file)
index 0000000..1020c97
--- /dev/null
@@ -0,0 +1,108 @@
+/* ====================================================================
+ * Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without 
+ * modification, are permitted provided that the following conditions 
+ * are met: 
+ * 
+ * 1. Redistributions of source code must retain the above copyright 
+ *    notice, this list of conditions and the following disclaimer.  
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright 
+ *    notice, this list of conditions and the following disclaimer in 
+ *    the documentation and/or other materials provided with the 
+ *    distribution. 
+ * 
+ * 3. All advertising materials mentioning features or use of this 
+ *    software must display the following acknowledgment: 
+ *    "This product includes software developed by the Apache Group 
+ *    for use in the Apache HTTP server project (http://www.apache.org/)." 
+ * 
+ * 4. The names "Apache Server" and "Apache Group" must not be used to 
+ *    endorse or promote products derived from this software without 
+ *    prior written permission. For written permission, please contact 
+ *    apache@apache.org. 
+ * 
+ * 5. Products derived from this software may not be called "Apache" 
+ *    nor may "Apache" appear in their names without prior written 
+ *    permission of the Apache Group. 
+ * 
+ * 6. Redistributions of any form whatsoever must retain the following 
+ *    acknowledgment: 
+ *    "This product includes software developed by the Apache Group 
+ *    for use in the Apache HTTP server project (http://www.apache.org/)." 
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY 
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE APACHE GROUP OR 
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * ==================================================================== 
+ * 
+ * This software consists of voluntary contributions made by many 
+ * individuals on behalf of the Apache Group and was originally based 
+ * on public domain software written at the National Center for 
+ * Supercomputing Applications, University of Illinois, Urbana-Champaign. 
+ * For more information on the Apache Group and the Apache HTTP server 
+ * project, please see <http://www.apache.org/>. 
+ * 
+ */ 
+
+#ifndef APACHE_MPM_DEFAULT_H
+#define APACHE_MPM_DEFAULT_H
+
+/* Number of servers to spawn off by default --- also, if fewer than
+ * this free when the caretaker checks, it will spawn more.
+ */
+#ifndef DEFAULT_START_DAEMON
+#define DEFAULT_START_DAEMON 5
+#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 10
+#endif
+
+/* Minimum --- fewer than this, and more will be created */
+
+#ifndef DEFAULT_MIN_FREE_DAEMON
+#define DEFAULT_MIN_FREE_DAEMON 5
+#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.
+ */
+#ifndef HARD_SERVER_LIMIT
+#define HARD_SERVER_LIMIT 8 
+#endif
+
+/* Limit on the threads per process.  Clients will be locked out if more than
+ * this  * HARD_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 HARD_THREAD_LIMIT
+#define HARD_THREAD_LIMIT 64 
+#endif
+
+#endif /* AP_MPM_DEFAULT_H */
index 8cb6784653ddfa27373adc1fedb3c6d62d8b70e2..c1277507f6925a1124b41c63a9075804bf50702b 100644 (file)
@@ -70,6 +70,8 @@ extern "C" {
 #endif /* TPF */
 #endif
 
+#include "mpm_default.h"       /* For HARD_.*_LIMIT */
+
 /* Scoreboard info on a process is, for now, kept very brief --- 
  * just status value and pid (the latter so that the caretaker process
  * can properly update the scoreboard when a process dies).  We may want
diff --git a/server/mpm/prefork/mpm_default.h b/server/mpm/prefork/mpm_default.h
new file mode 100644 (file)
index 0000000..3ff9ac2
--- /dev/null
@@ -0,0 +1,97 @@
+/* ====================================================================
+ * Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without 
+ * modification, are permitted provided that the following conditions 
+ * are met: 
+ * 
+ * 1. Redistributions of source code must retain the above copyright 
+ *    notice, this list of conditions and the following disclaimer.  
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright 
+ *    notice, this list of conditions and the following disclaimer in 
+ *    the documentation and/or other materials provided with the 
+ *    distribution. 
+ * 
+ * 3. All advertising materials mentioning features or use of this 
+ *    software must display the following acknowledgment: 
+ *    "This product includes software developed by the Apache Group 
+ *    for use in the Apache HTTP server project (http://www.apache.org/)." 
+ * 
+ * 4. The names "Apache Server" and "Apache Group" must not be used to 
+ *    endorse or promote products derived from this software without 
+ *    prior written permission. For written permission, please contact 
+ *    apache@apache.org. 
+ * 
+ * 5. Products derived from this software may not be called "Apache" 
+ *    nor may "Apache" appear in their names without prior written 
+ *    permission of the Apache Group. 
+ * 
+ * 6. Redistributions of any form whatsoever must retain the following 
+ *    acknowledgment: 
+ *    "This product includes software developed by the Apache Group 
+ *    for use in the Apache HTTP server project (http://www.apache.org/)." 
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY 
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE APACHE GROUP OR 
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * ==================================================================== 
+ * 
+ * This software consists of voluntary contributions made by many 
+ * individuals on behalf of the Apache Group and was originally based 
+ * on public domain software written at the National Center for 
+ * Supercomputing Applications, University of Illinois, Urbana-Champaign. 
+ * For more information on the Apache Group and the Apache HTTP server 
+ * project, please see <http://www.apache.org/>. 
+ * 
+ */ 
+
+#ifndef APACHE_MPM_DEFAULT_H
+#define APACHE_MPM_DEFAULT_H
+
+/* Number of servers to spawn off by default --- also, if fewer than
+ * this free when the caretaker checks, it will spawn more.
+ */
+#ifndef DEFAULT_START_DAEMON
+#define DEFAULT_START_DAEMON 5
+#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 10
+#endif
+
+/* Minimum --- fewer than this, and more will be created */
+
+#ifndef DEFAULT_MIN_FREE_DAEMON
+#define DEFAULT_MIN_FREE_DAEMON 5
+#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.
+ */
+#ifndef HARD_SERVER_LIMIT
+#define HARD_SERVER_LIMIT 256
+#endif
+
+#endif /* AP_MPM_DEFAULT_H */
index 07cae2d0cb6ee942446eaed5eaf7524bdaed3cb4..ebc4f3085e0614f17885841afe647c90c836486f 100644 (file)
@@ -88,6 +88,7 @@
 #define CORE_PRIVATE
 
 #include "httpd.h"
+#include "mpm_default.h"
 #include "http_main.h"
 #include "http_log.h"
 #include "http_config.h"
diff --git a/server/mpm/spmt_os2/mpm_default.h b/server/mpm/spmt_os2/mpm_default.h
new file mode 100644 (file)
index 0000000..3ff9ac2
--- /dev/null
@@ -0,0 +1,97 @@
+/* ====================================================================
+ * Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without 
+ * modification, are permitted provided that the following conditions 
+ * are met: 
+ * 
+ * 1. Redistributions of source code must retain the above copyright 
+ *    notice, this list of conditions and the following disclaimer.  
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright 
+ *    notice, this list of conditions and the following disclaimer in 
+ *    the documentation and/or other materials provided with the 
+ *    distribution. 
+ * 
+ * 3. All advertising materials mentioning features or use of this 
+ *    software must display the following acknowledgment: 
+ *    "This product includes software developed by the Apache Group 
+ *    for use in the Apache HTTP server project (http://www.apache.org/)." 
+ * 
+ * 4. The names "Apache Server" and "Apache Group" must not be used to 
+ *    endorse or promote products derived from this software without 
+ *    prior written permission. For written permission, please contact 
+ *    apache@apache.org. 
+ * 
+ * 5. Products derived from this software may not be called "Apache" 
+ *    nor may "Apache" appear in their names without prior written 
+ *    permission of the Apache Group. 
+ * 
+ * 6. Redistributions of any form whatsoever must retain the following 
+ *    acknowledgment: 
+ *    "This product includes software developed by the Apache Group 
+ *    for use in the Apache HTTP server project (http://www.apache.org/)." 
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY 
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE APACHE GROUP OR 
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * ==================================================================== 
+ * 
+ * This software consists of voluntary contributions made by many 
+ * individuals on behalf of the Apache Group and was originally based 
+ * on public domain software written at the National Center for 
+ * Supercomputing Applications, University of Illinois, Urbana-Champaign. 
+ * For more information on the Apache Group and the Apache HTTP server 
+ * project, please see <http://www.apache.org/>. 
+ * 
+ */ 
+
+#ifndef APACHE_MPM_DEFAULT_H
+#define APACHE_MPM_DEFAULT_H
+
+/* Number of servers to spawn off by default --- also, if fewer than
+ * this free when the caretaker checks, it will spawn more.
+ */
+#ifndef DEFAULT_START_DAEMON
+#define DEFAULT_START_DAEMON 5
+#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 10
+#endif
+
+/* Minimum --- fewer than this, and more will be created */
+
+#ifndef DEFAULT_MIN_FREE_DAEMON
+#define DEFAULT_MIN_FREE_DAEMON 5
+#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.
+ */
+#ifndef HARD_SERVER_LIMIT
+#define HARD_SERVER_LIMIT 256
+#endif
+
+#endif /* AP_MPM_DEFAULT_H */
index bc59f4cf4216814b5032af7b80d89bedbdec5b21..7a6b39f783d5485f5cc71d1baeb37065ccc32020 100644 (file)
@@ -60,6 +60,7 @@
 #define CORE_PRIVATE
 
 #include "httpd.h"
+#include "mpm_default.h"
 #include "http_main.h"
 #include "http_log.h"
 #include "http_config.h"