Yuvipanda has uploaded a new change for review.

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

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(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/72/133172/1

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: newchange
Gerrit-Change-Id: I8f9dc15c72e135dda00cba776215db0bea274f35
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Yuvipanda <yuvipa...@gmail.com>

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

Reply via email to