BBlack has uploaded a new change for review.

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

Change subject: cache_upload: separate applayer backend for thumbs
......................................................................

cache_upload: separate applayer backend for thumbs

These all actually go to the same service, but this will let us
route thumbs and originals to eqiad-vs-codfw independently of one
another.

Bug: T125510
Change-Id: Iea184041e47220866c531a9be70215b8052354fd
---
M hieradata/common/cache/upload.yaml
M hieradata/labs.yaml
M modules/role/manifests/cache/upload.pp
M templates/varnish/upload-backend.inc.vcl.erb
4 files changed, 26 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/31/275531/1

diff --git a/hieradata/common/cache/upload.yaml 
b/hieradata/common/cache/upload.yaml
index cb38cbe..d8b4b2e 100644
--- a/hieradata/common/cache/upload.yaml
+++ b/hieradata/common/cache/upload.yaml
@@ -52,3 +52,8 @@
     backends:
       eqiad: 'ms-fe.svc.eqiad.wmnet'
       codfw: 'ms-fe.svc.codfw.wmnet'
+  swift-thumbs:
+    route: 'eqiad'
+    backends:
+      eqiad: 'ms-fe.svc.eqiad.wmnet'
+      codfw: 'ms-fe.svc.codfw.wmnet'
diff --git a/hieradata/labs.yaml b/hieradata/labs.yaml
index 189f780..5a170a8 100644
--- a/hieradata/labs.yaml
+++ b/hieradata/labs.yaml
@@ -85,6 +85,10 @@
       # ms emulator set in July 2013. Beta does not have Swift yet.
       # instance is an unpuppetized hack with nginx proxy.
       eqiad: '10.68.16.189' # deployment-upload.eqiad.wmflabs
+  swift-thumbs:
+    route: eqiad
+    backends:
+      eqiad: '10.68.16.189' # deployment-upload.eqiad.wmflabs
 role::cache::base::zero_site: 'http://zero.wikimedia.beta.wmflabs.org'
 role::cache::base::purge_host_only_upload_re: '^upload\.beta\.wmflabs\.org$'
 role::cache::base::purge_host_not_upload_re: '^(?!upload\.beta\.wmflabs\.org)'
diff --git a/modules/role/manifests/cache/upload.pp 
b/modules/role/manifests/cache/upload.pp
index 4754811..64e97b0 100644
--- a/modules/role/manifests/cache/upload.pp
+++ b/modules/role/manifests/cache/upload.pp
@@ -49,6 +49,18 @@
                 'max_connections'       => 1000,
             }
         },
+        'swift-thumbs'   => {
+            'dynamic'  => 'no',
+            'type'     => 'random',
+            'backends' => 
$apps['swift-thumbs']['backends'][$apps['swift-thumbs']['route']],
+            'be_opts'  => {
+                'port'                  => 80,
+                'connect_timeout'       => '5s',
+                'first_byte_timeout'    => '35s',
+                'between_bytes_timeout' => '4s',
+                'max_connections'       => 1000,
+            }
+        },
     }
 
     $common_vcl_config = {
diff --git a/templates/varnish/upload-backend.inc.vcl.erb 
b/templates/varnish/upload-backend.inc.vcl.erb
index ff15ab3..437c6b4 100644
--- a/templates/varnish/upload-backend.inc.vcl.erb
+++ b/templates/varnish/upload-backend.inc.vcl.erb
@@ -20,7 +20,11 @@
 sub cluster_be_recv_pre_purge { }
 
 sub cluster_be_recv_applayer_backend {
-       set req.backend = swift;
+       if (req.url ~ "^/+[^/]+/[^/]+/thumb/") {
+               set req.backend = swift-thumbs;
+       } else {
+               set req.backend = swift;
+       }
 }
 
 sub cluster_be_recv {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iea184041e47220866c531a9be70215b8052354fd
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