summaryrefslogtreecommitdiff
path: root/server/util_filter.c
diff options
context:
space:
mode:
authorYann Ylavic <ylavic@apache.org>2018-07-18 21:55:29 +0000
committerYann Ylavic <ylavic@apache.org>2018-07-18 21:55:29 +0000
commit8a6e1c3adaeff09563df4a9da8b72eca29befda6 (patch)
treec9320044ada29e59190b6edb9c587fac8ee3f19c /server/util_filter.c
parent9c10bd61516f1cf61957024b806b41dca0f74c33 (diff)
downloadhttpd-8a6e1c3adaeff09563df4a9da8b72eca29befda6.tar.gz
core: core output filter optimizations.
The core output filter used to determine first if it needed to block before trying to send its data (including set aside ones), and if so it did call send_brigade_blocking(). This can be avoided by making send_brigade_nonblocking() send as much data as possible (nonblocking), and only if data remain check whether they should be flushed (blocking), according to the same ap_filter_reinstate_brigade() heuristics but afterward. This allows both to simplify the code (axe send_brigade_blocking and some duplicated logic) and optimize sends since send_brigade_nonblocking() is now given all the buckets so it can make use of scatter/gather (iovec) or NOPUSH option with the whole picture. When sendfile is available and/or with fine tuning of FlushMaxThreshold (and ReadBufferSize) from r1836032, one can now take advantage of modern network speeds and bandwidth. This commit also adds some APLOG_TRACE6 messages for outputed bytes (including at mod_ssl level since splitting happens there when it's active). git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1836237 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'server/util_filter.c')
-rw-r--r--server/util_filter.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/server/util_filter.c b/server/util_filter.c
index 04c637a8a1..470547c37e 100644
--- a/server/util_filter.c
+++ b/server/util_filter.c
@@ -834,6 +834,12 @@ AP_DECLARE(apr_status_t) ap_filter_reinstate_brigade(ap_filter_t *f,
if (f->bb && !APR_BRIGADE_EMPTY(f->bb)) {
APR_BRIGADE_PREPEND(bb, f->bb);
}
+ if (!flush_upto) {
+ /* Just prepend all. */
+ return APR_SUCCESS;
+ }
+
+ *flush_upto = NULL;
/*
* Determine if and up to which bucket we need to do a blocking write:
@@ -865,8 +871,6 @@ AP_DECLARE(apr_status_t) ap_filter_reinstate_brigade(ap_filter_t *f,
* would read the whole bucket into memory later on.
*/
- *flush_upto = NULL;
-
bytes_in_brigade = 0;
non_file_bytes_in_brigade = 0;
eor_buckets_in_brigade = 0;