diff options
| author | Michael Pratt <mpratt@google.com> | 2026-03-04 16:25:04 -0500 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2026-03-04 13:58:55 -0800 |
| commit | d3bd4773859f3ab03cbbdf35026ad71fffc28196 (patch) | |
| tree | a556105ad5cf998f499a30b3ffa5bf2d13d6087a | |
| parent | d29b966ca794634ccd1758dcd59cd2c8baf23422 (diff) | |
| download | go-x-pkgsite-d3bd4773859f3ab03cbbdf35026ad71fffc28196.tar.xz | |
internal/config: reduce default max idle SQL connections
Prior to CL 747620, we used the database/sql.DB default idle connection
limit of 2. An increase from 2 to 10 is quite extreme. If there are many
instances, the total number of connections can be quite high.
Reduce the limit to 6, which is selected as enough to handle the
concurrent requests for median instances.
Change-Id: I38772cef6f365a65b82842f5a389e50f6a6a6964
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/751540
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
kokoro-CI: kokoro <noreply+kokoro@google.com>
Auto-Submit: Michael Pratt <mpratt@google.com>
Reviewed-by: Nicholas Husin <nsh@golang.org>
Reviewed-by: Nicholas Husin <husin@google.com>
| -rw-r--r-- | internal/config/config.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/config/config.go b/internal/config/config.go index bd5994d2..1122bcaf 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -156,8 +156,8 @@ const ( DefaultDBMaxOpenConns = 80 // DefaultDBMaxIdleConns is the default maximum number of idle connections in the pool. - // 10 is a conservative value for horizontal scaling. - DefaultDBMaxIdleConns = 10 + // 6 is a conservative value for horizontal scaling. + DefaultDBMaxIdleConns = 6 // DefaultDBConnMaxLifetime is the default maximum amount of time a connection may be reused. DefaultDBConnMaxLifetime = time.Hour |
