motorz.h revision a79724574b554eb79b351f9d76ca78f56ac6b476
08cb74ca432a8c24e39f17dedce527e6a47b8001jerenkrantz/* Licensed to the Apache Software Foundation (ASF) under one or more
08cb74ca432a8c24e39f17dedce527e6a47b8001jerenkrantz * contributor license agreements. See the NOTICE file distributed with
b0fb330a8581c8bfab5e523084f9f39264a52b12gstein * this work for additional information regarding copyright ownership.
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd * The ASF licenses this file to You under the Apache License, Version 2.0
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd * (the "License"); you may not use this file except in compliance with
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd * the License. You may obtain a copy of the License at
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd * Unless required by applicable law or agreed to in writing, software
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd * distributed under the License is distributed on an "AS IS" BASIS,
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd * See the License for the specific language governing permissions and
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd * limitations under the License.
707ecf9559338ec06b24334bc9abcca670325cc4gstein/* Limit on the total --- clients will be locked out if more servers than
52c1d304b1bd8e05da40a7cded2ecb9f0ba614c5gstein * this are needed. It is intended solely to keep the server from crashing
f4c310fd2555c6faca1f980f00b161eadb089023gstein * when things get out of hand.
f4c310fd2555c6faca1f980f00b161eadb089023gstein * We keep a hard maximum number of servers, for two reasons --- first off,
f4c310fd2555c6faca1f980f00b161eadb089023gstein * in case something goes seriously wrong, we want to stop the fork bomb
707ecf9559338ec06b24334bc9abcca670325cc4gstein * short of actually crashing the machine we're running on by filling some
707ecf9559338ec06b24334bc9abcca670325cc4gstein * kernel table. Secondly, it keeps the size of the scoreboard file small
707ecf9559338ec06b24334bc9abcca670325cc4gstein * enough that we can read the whole thing without worrying too much about
707ecf9559338ec06b24334bc9abcca670325cc4gstein * the overhead.
707ecf9559338ec06b24334bc9abcca670325cc4gstein/* Admin can't tune ServerLimit beyond MAX_SERVER_LIMIT. We want
707ecf9559338ec06b24334bc9abcca670325cc4gstein * some sort of compile-time limit to help catch typos.
707ecf9559338ec06b24334bc9abcca670325cc4gstein/* Limit on the threads per process. Clients will be locked out if more than
707ecf9559338ec06b24334bc9abcca670325cc4gstein * this are needed.
707ecf9559338ec06b24334bc9abcca670325cc4gstein * We keep this for one reason it keeps the size of the scoreboard file small
707ecf9559338ec06b24334bc9abcca670325cc4gstein * enough that we can read the whole thing without worrying too much about
707ecf9559338ec06b24334bc9abcca670325cc4gstein * the overhead.
0e8fe062a6ec71b4207d1a125ee6b44b7fd30857gstein/* Admin can't tune ThreadLimit beyond MAX_THREAD_LIMIT. We want
f4c310fd2555c6faca1f980f00b161eadb089023gstein * some sort of compile-time limit to help catch typos.
f4c310fd2555c6faca1f980f00b161eadb089023gstein#define MPM_CHILD_PID(i) (ap_scoreboard_image->parent[i].pid)
f4c310fd2555c6faca1f980f00b161eadb089023gstein/* data retained by prefork across load/unload of the module
f4c310fd2555c6faca1f980f00b161eadb089023gstein * allocated on first call to pre-config hook; located on
6f15570e3adc0faf87bf55f70857028276fc9e32wrowe * subsequent calls to pre-config hook
0b1895a2cd5b4a9450709abdb7ae9974908f9382gstein int volatile is_graceful; /* set from signal handler */
0b1895a2cd5b4a9450709abdb7ae9974908f9382gstein * The max child slot ever assigned, preserved across restarts. Necessary
0b1895a2cd5b4a9450709abdb7ae9974908f9382gstein * to deal with MaxRequestWorkers changes across AP_SIG_GRACEFUL restarts. We
0b1895a2cd5b4a9450709abdb7ae9974908f9382gstein * use this value to optimize routines that have to scan the entire scoreboard.
0e8fe062a6ec71b4207d1a125ee6b44b7fd30857gsteintypedef struct motorz_child_bucket motorz_child_bucket;
0e8fe062a6ec71b4207d1a125ee6b44b7fd30857gsteintypedef enum
0e8fe062a6ec71b4207d1a125ee6b44b7fd30857gsteintypedef void (*motorz_timer_cb) (motorz_core_t *mz, void *baton);
0e8fe062a6ec71b4207d1a125ee6b44b7fd30857gsteintypedef void (*motorz_io_sock_cb) (motorz_core_t *mz, apr_socket_t *sock,
0b1895a2cd5b4a9450709abdb7ae9974908f9382gsteintypedef void (*motorz_io_file_cb) (motorz_core_t *mz, apr_socket_t *sock,
1ccd992d37d62c8cb2056126f2234f64ec189bfddougm /** connection record this struct refers to */
f4c310fd2555c6faca1f980f00b161eadb089023gstein /** request record (if any) this struct refers to */
e8f95a682820a599fe41b22977010636be5c2717jim /** is the current conn_rec suspended? */
9ec6440fdeb81f04905959293b381ebbfa3114c2jorton /** poll file descriptor information */
9ec6440fdeb81f04905959293b381ebbfa3114c2jorton /** public parts of the connection state */