BBlack has uploaded a new change for review.

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

Change subject: text frontend VCL: copy 4-hit-wonder from upload
......................................................................

text frontend VCL: copy 4-hit-wonder from upload

Works well for upload and seems equally-applicable here, although
we might eventually tune their cutoffs differently.  This doesn't
affect pass_random behavior AFAICS.  In theory, this could have
been factored our differently to move this to common code with a
vcl_config flag, but there's a lot of complexity in the details
(ordering, layering, retvals) that makes this far simpler for now,
and the other two clusters don't have the cache pressure to care
yet.

Change-Id: Iba6f691c6246dd2bd624c150d7985e8a0b2cca44
---
M modules/varnish/templates/text-frontend.inc.vcl.erb
1 file changed, 16 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/94/311994/1

diff --git a/modules/varnish/templates/text-frontend.inc.vcl.erb 
b/modules/varnish/templates/text-frontend.inc.vcl.erb
index 5e5b593..1bdb21d 100644
--- a/modules/varnish/templates/text-frontend.inc.vcl.erb
+++ b/modules/varnish/templates/text-frontend.inc.vcl.erb
@@ -221,6 +221,22 @@
 sub cluster_fe_backend_response {
        call text_common_backend_response;
 
+       // Four-hit-wonder experiment: if the immediate backend does not 
indicate
+       // hit/4 or higher, deliver the object as normal but do not create a new
+       // cache entry of any kind.  We start caching in the frontend when an
+       // object is accessed for the 5th time across all frontends in this DC.
+       if (beresp.status == 200
+            && bereq.http.X-CDIS == "miss"
+            && beresp.http.X-Cache-Int !~ " hit/([4-9]|[0-9]{2,})$") {
+               set beresp.ttl = 0s;
+               <%- if @varnish_version4 -%>
+               set beresp.uncacheable = true;
+               return (deliver);
+               <%- else -%>
+               return (hit_for_pass);
+               <%- end -%>
+       }
+
        return (deliver);
 }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iba6f691c6246dd2bd624c150d7985e8a0b2cca44
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: BBlack <bbl...@wikimedia.org>

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

Reply via email to