mpm_default.h revision 890719ecc8651cc01efc39b26560c56d37ceaed5
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess/* ====================================================================
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess * The Apache Software License, Version 1.1
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess *
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess * Copyright (c) 2000 The Apache Software Foundation. All rights
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess * reserved.
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess *
5a58787efeb02a1c3f06569d019ad81fd2efa06end * Redistribution and use in source and binary forms, with or without
5a58787efeb02a1c3f06569d019ad81fd2efa06end * modification, are permitted provided that the following conditions
5a58787efeb02a1c3f06569d019ad81fd2efa06end * are met:
5a58787efeb02a1c3f06569d019ad81fd2efa06end *
5a58787efeb02a1c3f06569d019ad81fd2efa06end * 1. Redistributions of source code must retain the above copyright
5a58787efeb02a1c3f06569d019ad81fd2efa06end * notice, this list of conditions and the following disclaimer.
5a58787efeb02a1c3f06569d019ad81fd2efa06end *
5a58787efeb02a1c3f06569d019ad81fd2efa06end * 2. Redistributions in binary form must reproduce the above copyright
52fff662005b1866a3ff09bb6c902800c5cc6dedjerenkrantz * notice, this list of conditions and the following disclaimer in
5a58787efeb02a1c3f06569d019ad81fd2efa06end * the documentation and/or other materials provided with the
5a58787efeb02a1c3f06569d019ad81fd2efa06end * distribution.
5a58787efeb02a1c3f06569d019ad81fd2efa06end *
4b5981e276e93df97c34e4da05ca5cf8bbd937dand * 3. The end-user documentation included with the redistribution,
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd * if any, must include the following acknowledgment:
4be0f2d2988dc74815a5f9f4a308fbef2c29674ekess * "This product includes software developed by the
4be0f2d2988dc74815a5f9f4a308fbef2c29674ekess * Apache Software Foundation (http://www.apache.org/)."
d05d0eb4ae6d2a5e513fc3bf2555ce33da416634nd * Alternately, this acknowledgment may appear in the software itself,
7f5b59ccc63c0c0e3e678a168f09ee6a2f51f9d0nd * if and wherever such third-party acknowledgments normally appear.
ecc5150d35c0dc5ee5119c2717e6660fa331abbftakashi *
ecc5150d35c0dc5ee5119c2717e6660fa331abbftakashi * 4. The names "Apache" and "Apache Software Foundation" must
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd * not be used to endorse or promote products derived from this
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd * software without prior written permission. For written
2d65870e5794cea54f4001239169a891789b7890nd * permission, please contact apache@apache.org.
5a58787efeb02a1c3f06569d019ad81fd2efa06end *
5a58787efeb02a1c3f06569d019ad81fd2efa06end * 5. Products derived from this software may not be called "Apache",
2b4e67038708a5b76abe74f381f0242421bc0012nd * nor may "Apache" appear in their name, without prior written
5a58787efeb02a1c3f06569d019ad81fd2efa06end * permission of the Apache Software Foundation.
a290fea4668ef3d7b7de3efbd5696c2c1ac2cbd9rbowen *
5a58787efeb02a1c3f06569d019ad81fd2efa06end * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
5a58787efeb02a1c3f06569d019ad81fd2efa06end * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
5a58787efeb02a1c3f06569d019ad81fd2efa06end * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
60a4b2c422dcbb08a554fb193105c08da592718bpoirier * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
2d65870e5794cea54f4001239169a891789b7890nd * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
60a4b2c422dcbb08a554fb193105c08da592718bpoirier * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
60a4b2c422dcbb08a554fb193105c08da592718bpoirier * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
2b4e67038708a5b76abe74f381f0242421bc0012nd * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2d65870e5794cea54f4001239169a891789b7890nd * SUCH DAMAGE.
2d65870e5794cea54f4001239169a891789b7890nd * ====================================================================
2d65870e5794cea54f4001239169a891789b7890nd *
2d65870e5794cea54f4001239169a891789b7890nd * This software consists of voluntary contributions made by many
a290fea4668ef3d7b7de3efbd5696c2c1ac2cbd9rbowen * individuals on behalf of the Apache Software Foundation. For more
a290fea4668ef3d7b7de3efbd5696c2c1ac2cbd9rbowen * information on the Apache Software Foundation, please see
8e9c6d6438af1ccb46adaa60d34caa3ac98f3851igalic * <http://www.apache.org/>.
8e9c6d6438af1ccb46adaa60d34caa3ac98f3851igalic *
8e9c6d6438af1ccb46adaa60d34caa3ac98f3851igalic * Portions of this software are based upon public domain software
8e9c6d6438af1ccb46adaa60d34caa3ac98f3851igalic * originally written at the National Center for Supercomputing Applications,
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess * University of Illinois, Urbana-Champaign.
6e14faf37935e36804b8bad802bc9dd58f3cf65dsf */
4cb65c31bc681540ea623e1cb2bdd09749fb8d7esf
6e14faf37935e36804b8bad802bc9dd58f3cf65dsf#ifndef APACHE_MPM_DEFAULT_H
6e14faf37935e36804b8bad802bc9dd58f3cf65dsf#define APACHE_MPM_DEFAULT_H
2b4e67038708a5b76abe74f381f0242421bc0012nd
2b4e67038708a5b76abe74f381f0242421bc0012nd/* Number of threads to spawn off by default --- also, if fewer than
2b4e67038708a5b76abe74f381f0242421bc0012nd * this free when the caretaker checks, it will spawn more.
2b4e67038708a5b76abe74f381f0242421bc0012nd */
2b4e67038708a5b76abe74f381f0242421bc0012nd#ifndef DEFAULT_START_THREAD
2b4e67038708a5b76abe74f381f0242421bc0012nd#define DEFAULT_START_THREAD 5
2b4e67038708a5b76abe74f381f0242421bc0012nd#endif
2b4e67038708a5b76abe74f381f0242421bc0012nd
6e14faf37935e36804b8bad802bc9dd58f3cf65dsf/* Maximum number of *free* server threads --- more than this, and
2b4e67038708a5b76abe74f381f0242421bc0012nd * they will die off.
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf#ifndef DEFAULT_MAX_SPARE_THREAD
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf#define DEFAULT_MAX_SPARE_THREAD 10
6e14faf37935e36804b8bad802bc9dd58f3cf65dsf#endif
6e14faf37935e36804b8bad802bc9dd58f3cf65dsf*/
4cb65c31bc681540ea623e1cb2bdd09749fb8d7esf
6e14faf37935e36804b8bad802bc9dd58f3cf65dsf/* Minimum --- fewer than this, and more will be created */
6e14faf37935e36804b8bad802bc9dd58f3cf65dsf/*
6e14faf37935e36804b8bad802bc9dd58f3cf65dsf#ifndef DEFAULT_MIN_SPARE_THREAD
6e14faf37935e36804b8bad802bc9dd58f3cf65dsf#define DEFAULT_MIN_SPARE_THREAD 5
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf#endif
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf*/
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf
4cb65c31bc681540ea623e1cb2bdd09749fb8d7esf/* Limit on the threads per process. Clients will be locked out if more than
5a58787efeb02a1c3f06569d019ad81fd2efa06end * this * HARD_SERVER_LIMIT are needed.
5a58787efeb02a1c3f06569d019ad81fd2efa06end *
5a58787efeb02a1c3f06569d019ad81fd2efa06end * We keep this for one reason it keeps the size of the scoreboard file small
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess * enough that we can read the whole thing without worrying too much about
6e14faf37935e36804b8bad802bc9dd58f3cf65dsf * the overhead.
6e14faf37935e36804b8bad802bc9dd58f3cf65dsf */
6e14faf37935e36804b8bad802bc9dd58f3cf65dsf#ifndef HARD_THREAD_LIMIT
6e14faf37935e36804b8bad802bc9dd58f3cf65dsf#define HARD_THREAD_LIMIT 4096
2d65870e5794cea54f4001239169a891789b7890nd#endif
2d65870e5794cea54f4001239169a891789b7890nd
2d65870e5794cea54f4001239169a891789b7890nd/* Number of servers to spawn off by default
2d65870e5794cea54f4001239169a891789b7890nd */
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess#ifndef DEFAULT_NUM_DAEMON
d13b6921a1ab0e823f5a028da1d5f9c83bfc75c2rbowen#define DEFAULT_NUM_DAEMON 1
2b4e67038708a5b76abe74f381f0242421bc0012nd#endif
2b4e67038708a5b76abe74f381f0242421bc0012nd
2b4e67038708a5b76abe74f381f0242421bc0012nd/* Limit on the total --- clients will be locked out if more servers than
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf * this are needed. It is intended solely to keep the server from crashing
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf * when things get out of hand.
2b4e67038708a5b76abe74f381f0242421bc0012nd *
2b4e67038708a5b76abe74f381f0242421bc0012nd * We keep a hard maximum number of servers, for two reasons --- first off,
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf * in case something goes seriously wrong, we want to stop the fork bomb
2b4e67038708a5b76abe74f381f0242421bc0012nd * short of actually crashing the machine we're running on by filling some
2b4e67038708a5b76abe74f381f0242421bc0012nd * kernel table. Secondly, it keeps the size of the scoreboard file small
2b4e67038708a5b76abe74f381f0242421bc0012nd * enough that we can read the whole thing without worrying too much about
d13b6921a1ab0e823f5a028da1d5f9c83bfc75c2rbowen * the overhead.
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess */
2d65870e5794cea54f4001239169a891789b7890nd#ifndef HARD_SERVER_LIMIT
2b4e67038708a5b76abe74f381f0242421bc0012nd#define HARD_SERVER_LIMIT 8
2b4e67038708a5b76abe74f381f0242421bc0012nd#endif
2d65870e5794cea54f4001239169a891789b7890nd
2d65870e5794cea54f4001239169a891789b7890nd/* Where the main/parent process's pid is logged */
2d65870e5794cea54f4001239169a891789b7890nd#ifndef DEFAULT_PIDLOG
ad9bf2bdf99926efa94c48dcc669c757b43b5fbfnd#define DEFAULT_PIDLOG "logs/httpd.pid"
2d65870e5794cea54f4001239169a891789b7890nd#endif
2b4e67038708a5b76abe74f381f0242421bc0012nd
2b4e67038708a5b76abe74f381f0242421bc0012nd/*
2b4e67038708a5b76abe74f381f0242421bc0012nd * Interval, in microseconds, between scoreboard maintenance.
2d65870e5794cea54f4001239169a891789b7890nd */
2d65870e5794cea54f4001239169a891789b7890nd#ifndef SCOREBOARD_MAINTENANCE_INTERVAL
2d65870e5794cea54f4001239169a891789b7890nd#define SCOREBOARD_MAINTENANCE_INTERVAL 1000000
2d65870e5794cea54f4001239169a891789b7890nd#endif
ad9bf2bdf99926efa94c48dcc669c757b43b5fbfnd
2b4e67038708a5b76abe74f381f0242421bc0012nd/* Number of requests to try to handle in a single process. If <= 0,
2d65870e5794cea54f4001239169a891789b7890nd * the children don't die off.
2d65870e5794cea54f4001239169a891789b7890nd */
2d65870e5794cea54f4001239169a891789b7890nd#ifndef DEFAULT_MAX_REQUESTS_PER_CHILD
2d65870e5794cea54f4001239169a891789b7890nd#define DEFAULT_MAX_REQUESTS_PER_CHILD 10000
2d65870e5794cea54f4001239169a891789b7890nd#endif
2d65870e5794cea54f4001239169a891789b7890nd
6e14faf37935e36804b8bad802bc9dd58f3cf65dsf#endif /* AP_MPM_DEFAULT_H */
2d65870e5794cea54f4001239169a891789b7890nd