Andrew Bogott has submitted this change and it was merged.

Change subject: dynamicproxy: Use redis connection pooling
......................................................................


dynamicproxy: Use redis connection pooling

Bug: 65179
Change-Id: I8f9dc15c72e135dda00cba776215db0bea274f35
---
M modules/dynamicproxy/files/domainproxy.lua
M modules/dynamicproxy/files/urlproxy.lua
2 files changed, 8 insertions(+), 0 deletions(-)

Approvals:
  Andrew Bogott: Looks good to me, approved
  Tim Landscheidt: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/modules/dynamicproxy/files/domainproxy.lua 
b/modules/dynamicproxy/files/domainproxy.lua
index d1afb5d..6d81bdb 100644
--- a/modules/dynamicproxy/files/domainproxy.lua
+++ b/modules/dynamicproxy/files/domainproxy.lua
@@ -25,6 +25,10 @@
 
 local backend = red:srandmember('frontend:' .. frontend)
 
+-- Use a connection pool of 256 connections with a 32s idle timeout
+-- This also closes the current redis connection.
+red:set_keepalive(1000 * 32, 256)
+
 if backend == ngx.null then
     -- Handle frontends wihout any configuration in them
     ngx.exit(404)
diff --git a/modules/dynamicproxy/files/urlproxy.lua 
b/modules/dynamicproxy/files/urlproxy.lua
index e23f8f8..0cb877a 100644
--- a/modules/dynamicproxy/files/urlproxy.lua
+++ b/modules/dynamicproxy/files/urlproxy.lua
@@ -54,6 +54,10 @@
     end
 end
 
+-- Use a connection pool of 256 connections with a 32s idle timeout
+-- This also closes the current redis connection.
+red:set_keepalive(1000 * 32, 256)
+
 if route then
     ngx.var.backend = route
     ngx.exit(ngx.OK)

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I8f9dc15c72e135dda00cba776215db0bea274f35
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Yuvipanda <yuvipa...@gmail.com>
Gerrit-Reviewer: Andrew Bogott <abog...@wikimedia.org>
Gerrit-Reviewer: Petrb <benap...@gmail.com>
Gerrit-Reviewer: Tim Landscheidt <t...@tim-landscheidt.de>
Gerrit-Reviewer: coren <mpellet...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to