Faidon Liambotis has submitted this change and it was merged.

Change subject: Varnish: set backend_random for POSTs
......................................................................


Varnish: set backend_random for POSTs

POSTs are uncacheable, so consistent hashing is not only useless but
also creates unnecessary hotspots (e.g. enwiki's api.php).

Change-Id: I6180031180a8efccb495761d71e6505c4a924c30
---
M templates/varnish/text-backend.inc.vcl.erb
M templates/varnish/text-frontend.inc.vcl.erb
2 files changed, 4 insertions(+), 2 deletions(-)

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



diff --git a/templates/varnish/text-backend.inc.vcl.erb 
b/templates/varnish/text-backend.inc.vcl.erb
index 59b97ed..e8a79ca 100644
--- a/templates/varnish/text-backend.inc.vcl.erb
+++ b/templates/varnish/text-backend.inc.vcl.erb
@@ -39,7 +39,8 @@
 <% end -%>
        call pass_requests;
 
-       if (req.url ~ "^/wiki/Special:CentralAutoLogin/" ||
+       if (req.request == "POST" ||
+           req.url ~ "^/wiki/Special:CentralAutoLogin/" ||
            req.url ~ 
"^/w/index.php\?title=Spezial:Zentrale_automatische_Anmeldung/") {
 <% if vcl_config.fetch("cluster_tier", "1") != "1" -%>
                set req.backend = <%= @vcl_config.fetch("default_backend", 
"backend") %>_random;
diff --git a/templates/varnish/text-frontend.inc.vcl.erb 
b/templates/varnish/text-frontend.inc.vcl.erb
index 234c714..af9c155 100644
--- a/templates/varnish/text-frontend.inc.vcl.erb
+++ b/templates/varnish/text-frontend.inc.vcl.erb
@@ -68,7 +68,8 @@
        call mobile_redirect;
        call pass_requests;
 
-       if (req.url ~ "^/wiki/Special:CentralAutoLogin/" ||
+       if (req.request == "POST" ||
+           req.url ~ "^/wiki/Special:CentralAutoLogin/" ||
            req.url ~ 
"^/w/index.php?title=Spezial:Zentrale_automatische_Anmeldung/") {
                set req.backend = backend_random;
                set req.hash_ignore_busy = true;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I6180031180a8efccb495761d71e6505c4a924c30
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Faidon Liambotis <[email protected]>
Gerrit-Reviewer: Faidon Liambotis <[email protected]>
Gerrit-Reviewer: jenkins-bot

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

Reply via email to