diff options
| author | Grant Limberg <[email protected]> | 2022-06-29 09:39:51 -0700 |
|---|---|---|
| committer | Grant Limberg <[email protected]> | 2022-06-29 09:39:51 -0700 |
| commit | 6fdc7be502d5251065400f89129bba5a7ecc9a3e (patch) | |
| tree | 467ef5995c7fb65aba1dab5db0c4a22e0d255215 /controller/PostgreSQL.cpp | |
| parent | 8fe858c5c6b2444028cf13f92cc980d9946a6f0d (diff) | |
redis connection pool tuning
Diffstat (limited to 'controller/PostgreSQL.cpp')
| -rw-r--r-- | controller/PostgreSQL.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/controller/PostgreSQL.cpp b/controller/PostgreSQL.cpp index 47324514..8e265da3 100644 --- a/controller/PostgreSQL.cpp +++ b/controller/PostgreSQL.cpp @@ -217,10 +217,11 @@ PostgreSQL::PostgreSQL(const Identity &myId, const char *path, int listenPort, R opts.password = _rc->password; opts.db = 0; opts.keep_alive = true; - opts.connect_timeout = std::chrono::seconds(5); + opts.connect_timeout = std::chrono::seconds(3); poolOpts.size = 25; - poolOpts.wait_timeout = std::chrono::milliseconds(1000); - poolOpts.connection_lifetime = std::chrono::minutes(5); + poolOpts.wait_timeout = std::chrono::seconds(5); + poolOpts.connection_lifetime = std::chrono::minutes(3); + poolOpts.connection_idle_time = std::chrono::minutes(1); if (_rc->clusterMode) { fprintf(stderr, "Using Redis in Cluster Mode\n"); _cluster = std::make_shared<sw::redis::RedisCluster>(opts, poolOpts); |
