diff options
author | Yann Ylavic <ylavic@apache.org> | 2018-01-02 16:44:17 +0100 |
---|---|---|
committer | Yann Ylavic <ylavic@apache.org> | 2018-01-02 16:44:17 +0100 |
commit | d3792903cfa2f2de282aace47a442b26d5e86c00 (patch) | |
tree | eb16d637eae8c2c398343275677fe915e0a0360f /server/mpm/event/event.c | |
parent | mpm_event: make sure wakeup_listener() does its minimal job. (diff) | |
download | apache2-d3792903cfa2f2de282aace47a442b26d5e86c00.tar.xz apache2-d3792903cfa2f2de282aace47a442b26d5e86c00.zip |
mpm_event: worker factor vs pollset.
Make sure the worker factor is at least one (w.r.t. WORKER_FACTOR_SCALE), and
use it to size the pollset appropriately (including K-A and lingering close
connections), in addition to the listening sockets.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1819852 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r-- | server/mpm/event/event.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/server/mpm/event/event.c b/server/mpm/event/event.c index 2d71f92319..8ff72d1996 100644 --- a/server/mpm/event/event.c +++ b/server/mpm/event/event.c @@ -2413,9 +2413,14 @@ static void *APR_THREAD_FUNC start_threads(apr_thread_t * thd, void *dummy) int loops; int prev_threads_created; int max_recycled_pools = -1; - int good_methods[] = {APR_POLLSET_KQUEUE, APR_POLLSET_PORT, APR_POLLSET_EPOLL}; - /* XXX don't we need more to handle K-A or lingering close? */ - const apr_uint32_t pollset_size = threads_per_child * 2; + const int good_methods[] = { APR_POLLSET_KQUEUE, + APR_POLLSET_PORT, + APR_POLLSET_EPOLL }; + /* XXX: K-A or lingering close connection included in the async factor */ + const apr_uint32_t async_factor = worker_factor / WORKER_FACTOR_SCALE; + const apr_uint32_t pollset_size = (apr_uint32_t)num_listensocks + + (apr_uint32_t)threads_per_child * + (async_factor > 2 ? async_factor : 2); /* We must create the fd queues before we start up the listener * and worker threads. */ @@ -4035,8 +4040,9 @@ static const char *set_worker_factor(cmd_parms * cmd, void *dummy, return "AsyncRequestWorkerFactor argument must be a positive number"; worker_factor = val * WORKER_FACTOR_SCALE; - if (worker_factor == 0) - worker_factor = 1; + if (worker_factor < WORKER_FACTOR_SCALE) { + worker_factor = WORKER_FACTOR_SCALE; + } return NULL; } |