Ema has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/343845 )

Change subject: varnish: swap around backend ttl cap and keep values [2/2]
......................................................................

varnish: swap around backend ttl cap and keep values [2/2]

Further reduce ttl_cap to 1d and bump keep to 7d.

When an object ttl expires but the object is within keep time, varnish
issues conditional requests to the origin server instead of full
fetches. This should help in various operational scenarios (eg: eqiad
cache_upload depooled for a whole weekend).

Bug: T124954
Change-Id: I2a04c24b5e41c99844c8a4e4e65c9093b915da39
---
M modules/varnish/templates/vcl/wikimedia-common.inc.vcl.erb
1 file changed, 4 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/45/343845/1

diff --git a/modules/varnish/templates/vcl/wikimedia-common.inc.vcl.erb 
b/modules/varnish/templates/vcl/wikimedia-common.inc.vcl.erb
index a4c6463..b7c7c54 100644
--- a/modules/varnish/templates/vcl/wikimedia-common.inc.vcl.erb
+++ b/modules/varnish/templates/vcl/wikimedia-common.inc.vcl.erb
@@ -283,9 +283,9 @@
        // cases later.
        unset beresp.http.X-CDIS;
 
-       // Hard TTL cap on all fetched objects (default 3d)
-       if (beresp.ttl > <%= @vcl_config.fetch("ttl_cap", "3d") %>) {
-               set beresp.ttl = <%= @vcl_config.fetch("ttl_cap", "3d") %>;
+       // Hard TTL cap on all fetched objects (default 1d)
+       if (beresp.ttl > <%= @vcl_config.fetch("ttl_cap", "1d") %>) {
+               set beresp.ttl = <%= @vcl_config.fetch("ttl_cap", "1d") %>;
        }
 
        /* Don't cache private, no-cache, no-store objects */
@@ -300,11 +300,7 @@
 
        set beresp.grace = <%= @vcl_config.fetch("grace_sick", "60m") %>;
 
-       if (beresp.ttl < <%= @vcl_config.fetch("keep", "3d") %>) {
-               set beresp.keep = beresp.ttl;
-       } else {
-               set beresp.keep = <%= @vcl_config.fetch("keep", "3d") %>;
-       }
+       set beresp.keep = <%= @vcl_config.fetch("keep", "7d") %>;
 
        // Compress compressible things if the backend didn't already
        if (beresp.http.content-type ~ 
"json|text|html|script|xml|icon|ms-fontobject|ms-opentype|x-font") {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2a04c24b5e41c99844c8a4e4e65c9093b915da39
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ema <[email protected]>

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

Reply via email to