Giuseppe Lavagetto has uploaded a new change for review.
https://gerrit.wikimedia.org/r/175951
Change subject: Revert "varnish: remove redirection to the hhvm pool"
......................................................................
Revert "varnish: remove redirection to the hhvm pool"
This reverts commit a2c6e98e1b47131fcc0645e21f1d03c86ac56a0e.
Change-Id: I47ae6e409c3c226b591e6897e99bc9a609132bac
---
M templates/varnish/bits.inc.vcl.erb
M templates/varnish/mobile-backend.inc.vcl.erb
M templates/varnish/text-backend.inc.vcl.erb
3 files changed, 26 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/operations/puppet
refs/changes/51/175951/1
diff --git a/templates/varnish/bits.inc.vcl.erb
b/templates/varnish/bits.inc.vcl.erb
index 6f4e20e..86ebb26 100644
--- a/templates/varnish/bits.inc.vcl.erb
+++ b/templates/varnish/bits.inc.vcl.erb
@@ -39,6 +39,12 @@
error 403 "HTTP method not allowed.";
}
+<% if vcl_config.fetch("cluster_tier", "1") == "1" -%>
+ if ( req.http.Cookie ~ "hhvm=true" ) {
+ set req.backend = hhvm_appservers;
+ }
+<% end -%>
+
if (req.http.host == "<%= cluster_options.fetch( "bits_domain",
"bits.wikimedia.org" )%>") {
/* For https-only wikis, the redirect from http to https for bits
assets should occur
in varnish instead of apache, since the apache redirect and
mediawiki doesn't
diff --git a/templates/varnish/mobile-backend.inc.vcl.erb
b/templates/varnish/mobile-backend.inc.vcl.erb
index 36e7ca4..39dd29c 100644
--- a/templates/varnish/mobile-backend.inc.vcl.erb
+++ b/templates/varnish/mobile-backend.inc.vcl.erb
@@ -19,6 +19,17 @@
}
<% end -%>
+<% if vcl_config.fetch("cluster_tier", "1") == "1" -%>
+ /* Use the hhvm backend for any request to the standard appservers */
+ if ( req.http.X-Orig-Cookie ~ "hhvm=true" ) {
+ if (req.backend == api) {
+ set req.backend = hhvm_api;
+ } else {
+ set req.backend = hhvm_appservers;
+ }
+ }
+<% end -%>
+
/* Default (now modified) Varnish vcl_recv function */
if (req.request != "GET" && req.request != "HEAD") {
/* We only deal with GET and HEAD by default */
diff --git a/templates/varnish/text-backend.inc.vcl.erb
b/templates/varnish/text-backend.inc.vcl.erb
index 30f23e3..9e27f3c 100644
--- a/templates/varnish/text-backend.inc.vcl.erb
+++ b/templates/varnish/text-backend.inc.vcl.erb
@@ -36,6 +36,15 @@
if (req.http.host ~ "^test\.") {
set req.backend = test_wikipedia;
}
+
+ /* Use the hhvm backend for any request to the standard appservers. */
+ if ( req.http.Cookie ~ "hhvm=true" ) {
+ if (req.backend == api) {
+ set req.backend = hhvm_api;
+ } else {
+ set req.backend = hhvm_appservers;
+ }
+ }
<% end -%>
call pass_requests;
--
To view, visit https://gerrit.wikimedia.org/r/175951
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I47ae6e409c3c226b591e6897e99bc9a609132bac
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Giuseppe Lavagetto <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits