jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/330870 )

Change subject: Enable Thumbor PoolCounter support
......................................................................


Enable Thumbor PoolCounter support

Bug: T151066
Change-Id: I80efc6766ad78ae89377205e929056e8356dcc71
---
M puppet/modules/swift/files/SwiftMedia/wmf/rewrite.py
M puppet/modules/thumbor/templates/20-thumbor-wikimedia.conf.erb
2 files changed, 36 insertions(+), 1 deletion(-)

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



diff --git a/puppet/modules/swift/files/SwiftMedia/wmf/rewrite.py 
b/puppet/modules/swift/files/SwiftMedia/wmf/rewrite.py
index 4d051ac..6c0b2ee 100644
--- a/puppet/modules/swift/files/SwiftMedia/wmf/rewrite.py
+++ b/puppet/modules/swift/files/SwiftMedia/wmf/rewrite.py
@@ -94,6 +94,10 @@
             if reqorig.headers.get(header_to_pass) is not None:
                 opener.addheaders.append((header_to_pass, 
reqorig.headers.get(header_to_pass)))
 
+        thumbor_opener.addheaders = opener.addheaders
+
+        self.logger.debug("Addheaders: %r" % thumbor_opener.addheaders)
+
         # At least in theory, we shouldn't be handing out links to originals
         # that we don't have (or in the case of thumbs, can't generate).
         # However, someone may have a formerly valid link to a file, so we
diff --git a/puppet/modules/thumbor/templates/20-thumbor-wikimedia.conf.erb 
b/puppet/modules/thumbor/templates/20-thumbor-wikimedia.conf.erb
index 7d0e942..5ae54c0 100644
--- a/puppet/modules/thumbor/templates/20-thumbor-wikimedia.conf.erb
+++ b/puppet/modules/thumbor/templates/20-thumbor-wikimedia.conf.erb
@@ -66,4 +66,35 @@
 MANHOLE_DEBUGGING = True
 
 # Overrides the community core class in order to install manhole
-APP_CLASS = 'wikimedia_thumbor.app.App'
\ No newline at end of file
+APP_CLASS = 'wikimedia_thumbor.app.App'
+
+# Poolcounter configuration
+
+POOLCOUNTER_SERVER = '127.0.0.1'
+POOLCOUNTER_PORT = 7531
+POOLCOUNTER_RELEASE_TIMEOUT = 120
+
+# Up to "workers" thumbnails can be generated at once for a given IP
+# address, with up to "maxqueue" thumbnails queued per IP
+POOLCOUNTER_CONFIG_PER_IP = {
+    'workers': 32,
+    'maxqueue': 500,
+    'timeout': 8
+}
+
+# Up to "workers" thumbnails can be generated at once for the same original
+# with up to a "maxqueue" other thumbnail requests for that original queued
+POOLCOUNTER_CONFIG_PER_ORIGINAL = {
+    'workers': 2,
+    'maxqueue': 100,
+    'timeout': 8
+}
+
+# An absolute maximum of "workers" expensive thumbnails can be processed at 
the same time,
+# queueing up to "maxqueue" other expensive thumbnails
+POOLCOUNTER_CONFIG_EXPENSIVE = {
+    'workers': 16,
+    'maxqueue': 100,
+    'timeout': 8,
+    'extensions': ['xcf', 'djvu', 'pdf', 'tiff']
+}
\ No newline at end of file

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I80efc6766ad78ae89377205e929056e8356dcc71
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: master
Gerrit-Owner: Gilles <[email protected]>
Gerrit-Reviewer: Gilles <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to