BBlack has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/276475

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(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/75/276475/1

diff --git a/modules/varnish/templates/vcl/wikimedia-common.inc.vcl.erb 
b/modules/varnish/templates/vcl/wikimedia-common.inc.vcl.erb
index 6d32ba0..37e6a1e 100644
--- a/modules/varnish/templates/vcl/wikimedia-common.inc.vcl.erb
+++ b/modules/varnish/templates/vcl/wikimedia-common.inc.vcl.erb
@@ -235,9 +235,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: newchange
Gerrit-Change-Id: I3fd4d56aeb4c297b4b2e2f36d7e54a28e2a11204
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: BBlack <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to