summaryrefslogtreecommitdiff
path: root/controller/PostgreSQL.cpp
diff options
context:
space:
mode:
authorGrant Limberg <[email protected]>2022-06-22 10:30:58 -0700
committerGrant Limberg <[email protected]>2022-06-22 10:30:58 -0700
commit9d4336d296eebabe3f9057c2c5b9959d1a5d452c (patch)
tree3eeddbe1ff070e52d116428500528636b8eb2ec7 /controller/PostgreSQL.cpp
parent17bc9d308505bb8c2c501021bd298efde06a7abb (diff)
redis connection tuning
Diffstat (limited to 'controller/PostgreSQL.cpp')
-rw-r--r--controller/PostgreSQL.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/controller/PostgreSQL.cpp b/controller/PostgreSQL.cpp
index 1700627d..4c561974 100644
--- a/controller/PostgreSQL.cpp
+++ b/controller/PostgreSQL.cpp
@@ -216,7 +216,11 @@ PostgreSQL::PostgreSQL(const Identity &myId, const char *path, int listenPort, R
opts.port = _rc->port;
opts.password = _rc->password;
opts.db = 0;
+ opts.keep_alive = true;
+ opts.connect_timeout = std::chrono::seconds(5);
poolOpts.size = 25;
+ poolOpts.wait_timeout = std::chrono::milliseconds(1000);
+ poolOpts.connection_lifetime = std::chrono::minutes(5);
if (_rc->clusterMode) {
fprintf(stderr, "Using Redis in Cluster Mode\n");
_cluster = std::make_shared<sw::redis::RedisCluster>(opts, poolOpts);