diff options
author | Yann Ylavic <ylavic@apache.org> | 2014-10-30 15:24:58 +0000 |
---|---|---|
committer | Yann Ylavic <ylavic@apache.org> | 2014-10-30 15:24:58 +0000 |
commit | 61d5a3c1cacccd6a07d2300711ff0691ee35d6fd (patch) | |
tree | dad1aceb1acfea6f4ddc3ce4eaeb812c24d65ba5 /server/log.c | |
parent | 8fb5d9a61ebd36af6ac8977ed3a9187f2398462e (diff) | |
download | httpd-61d5a3c1cacccd6a07d2300711ff0691ee35d6fd.tar.gz |
MPMs, core: make duplicated listeners (SO_REUSEPORT) introduced in r1599531
less intrusive.
Submitted by: Yingqi Lu <yingqi.lu@intel.com>
Modified/Committed by: ylavic
Add ListenCoresBucketsRatio which is a configurable ratio between the number of
CPU cores (online) and the number of listeners buckets to create, defaulting to
zero (so that listeners buckets become an opt-in, ie. ncpus / ratio > 1).
This could also be made an opt-out by using the previous hardcoded value (8) as
default.
Make ap_close_listeners() act on all the listeners (including duplicated ones),
since the function is also called externally (eg. mod_cgid, mod_ssl_ct and
possibly any third party module) to cleanup opened descriptors when a process
is forked (the duplicated listeners are kept in a scoped/static variable).
Add ap_close_listeners_ex() to close a single bucket of listeners, used by the
children to close unused duplicates and internally by ap_close_listeners().
Make ap_duplicate_listeners() compute the number of buckets to be used, instead
of each MPM. This number is now based on the above ratio and will not change
unless asked to (given *num_buckets < 1, that is when the MPM does not run in
one-process mode nor after a graceful restart).
Remove some global variables (mpm_listen, enable_default_listeners) previously
used to communicate between MPMs and ap_listen, since ap_duplicate_listeners()
API can now be used to do so.
Also rename num_buckets as ap_num_listen_buckets, and prefix have_so_reuseport
with ap_ (both printed by ap_log_common(), hence kept global).
Detect ap_have_so_reuseport once only at startup.
Restore dummy_connection() as before r1599531 since sending POD signals should
not depend on the number of listeners buckets (there is still one single socket
receiving the connections).
For each MPM (concerned), move the bucket data (pod, listeners and eventually
accept mutex) into a struct and instanciate an array of them (sized by the
number of buckets), for each child to use its own data according to its bucket
index, and the parent to maintain the whole.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1635521 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'server/log.c')
-rw-r--r-- | server/log.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/server/log.c b/server/log.c index 2d35d35e6c..07fb057487 100644 --- a/server/log.c +++ b/server/log.c @@ -1493,8 +1493,8 @@ AP_DECLARE(void) ap_log_common(server_rec *s) { ap_log_error(APLOG_MARK, APLOG_DEBUG , 0, s, APLOGNO(02639) "Using SO_REUSEPORT: %s (%d)", - have_so_reuseport ? "yes" : "no", - num_buckets); + ap_have_so_reuseport ? "yes" : "no", + ap_num_listen_buckets); } AP_DECLARE(void) ap_remove_pid(apr_pool_t *p, const char *rel_fname) |