From a4ba9b1adb70f08a0bee69fe79c012a8135dfc01 Mon Sep 17 00:00:00 2001 From: Jacob Hoffman-Andrews Date: Thu, 12 May 2022 16:29:26 -0700 Subject: [PATCH] rocsp/config: fix PoolSize comment (#6110) The go-redis docs say default is 10 * NumCPU, but the actual code says 5. Extra context: https://github.com/go-redis/redis/blob/2465baaab55d74ec9d5e42a971b2bf5dba3a6b29/options.go#L143-L145 https://github.com/go-redis/redis/blob/2465baaab55d74ec9d5e42a971b2bf5dba3a6b29/cluster.go#L96-L98 For Options, the default (documented) is 10 * NumCPUs. For ClusterOptions, the default (undocumented) is 5 * NumCPUs. We use ClusterOptions. Also worth noting: for ClusterOptions, the limit is per node. --- rocsp/config/rocsp_config.go | 5 ++++- test/config-next/ocsp-responder.json | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/rocsp/config/rocsp_config.go b/rocsp/config/rocsp_config.go index 1dfba22b0..625814ca8 100644 --- a/rocsp/config/rocsp_config.go +++ b/rocsp/config/rocsp_config.go @@ -53,7 +53,10 @@ type RedisConfig struct { WriteTimeout cmd.ConfigDuration // Maximum number of socket connections. - // Default is 10 connections per every CPU as reported by runtime.NumCPU. + // Default is 5 connections per every CPU as reported by runtime.NumCPU. + // If this is set to an explicit value, that's not multiplied by NumCPU. + // PoolSize applies per cluster node and not for the whole cluster. + // https://pkg.go.dev/github.com/go-redis/redis#ClusterOptions PoolSize int // Minimum number of idle connections which is useful when establishing // new connection is slow. diff --git a/test/config-next/ocsp-responder.json b/test/config-next/ocsp-responder.json index 654fec079..12b843aa7 100644 --- a/test/config-next/ocsp-responder.json +++ b/test/config-next/ocsp-responder.json @@ -11,6 +11,7 @@ "10.33.33.7:4218" ], "timeout": "5s", + "poolSize": 100, "tls": { "caCertFile": "test/redis-tls/minica.pem", "certFile": "test/redis-tls/boulder/cert.pem",