BBlack has submitted this change and it was merged.

Change subject: Varnish: stream all pass traffic
......................................................................


Varnish: stream all pass traffic

The default in varnish 3 is "do_stream = false", and nothing turns
it on other than explicit VCL.  Naively, one would assume that
streaming is always better than not-streaming, but there are
complications from Varnish:

Whether to turn it on for cache miss fetches is a tradeoff that
involves complex questions: the upside is immediate streaming to
the client instead of buffering the whole response first, but the
downside is that the cache object fills into varnish at the rate
the *client* is accepting the stream, and all other fetches from
other faster clients will stall out on that busy object (unless
hash_ignore_busy, which is yet another tradeoff decision).

However, for 'pass' traffic (from return pass or hit-for-pass),
turning on do_stream has no downsides, as pass traffic isn't
sharing a potentially-busy object with another client.  So this
should be a performance win for pass objects (especially large
ones) without any real downside.

Change-Id: I3fd4d56aeb4c297b4b2e2f36d7e54a28e2a11204
Ref: http://info.varnish-software.com/blog/streaming-varnish-30
---
M modules/varnish/templates/vcl/wikimedia-common.inc.vcl.erb
1 file changed, 6 insertions(+), 0 deletions(-)

Approvals:
  BBlack: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/varnish/templates/vcl/wikimedia-common.inc.vcl.erb 
b/modules/varnish/templates/vcl/wikimedia-common.inc.vcl.erb
index fdd7a28..bd6da1c7 100644
--- a/modules/varnish/templates/vcl/wikimedia-common.inc.vcl.erb
+++ b/modules/varnish/templates/vcl/wikimedia-common.inc.vcl.erb
@@ -234,9 +234,15 @@
        } else {
                set req.http.X-CDIS = "pass";
        }
+
+       set req.http.X-Pass-Stream = 1;
 }
 
 sub wm_common_fetch {
+       if (req.http.X-Pass-Stream) {
+               set beresp.do_stream = true;
+       }
+
 <% if @vcl_config.fetch("ttl_fixed", false) -%>
        // Fixed TTL (rare/questionable, only used on upload backend right now)
        // Note the ttl_cap comes after this and takes precedence!

-- 
To view, visit https://gerrit.wikimedia.org/r/276475
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I3fd4d56aeb4c297b4b2e2f36d7e54a28e2a11204
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: BBlack <bbl...@wikimedia.org>
Gerrit-Reviewer: BBlack <bbl...@wikimedia.org>
Gerrit-Reviewer: Ema <e...@wikimedia.org>
Gerrit-Reviewer: Faidon Liambotis <fai...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to