diff options
author | 2023-02-01 11:55:34 +0100 | |
---|---|---|
committer | 2023-02-01 11:55:34 +0100 | |
commit | 4ee4cd2da11bc0199ee99a40527e758d394dbc9c (patch) | |
tree | 2eafd22e03801c78590e59e6682ee833851c8037 /internal | |
parent | [chore] Use 'immediate' lock for sqlite transactions (#1404) (diff) | |
download | gotosocial-4ee4cd2da11bc0199ee99a40527e758d394dbc9c.tar.xz |
[chore/performance] use only 1 sqlite db connection regardless of multiplier (#1408)
Diffstat (limited to 'internal')
-rw-r--r-- | internal/db/bundb/bundb.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/internal/db/bundb/bundb.go b/internal/db/bundb/bundb.go index 6587ab8ad..0ab1d1b83 100644 --- a/internal/db/bundb/bundb.go +++ b/internal/db/bundb/bundb.go @@ -304,9 +304,9 @@ func sqliteConn(ctx context.Context) (*DBConn, error) { // Tune db connections for sqlite, see: // - https://bun.uptrace.dev/guide/running-bun-in-production.html#database-sql // - https://www.alexedwards.net/blog/configuring-sqldb - sqldb.SetMaxOpenConns(maxOpenConns()) // x number of conns per cpu - sqldb.SetMaxIdleConns(1) // only keep max 1 idle connection around - sqldb.SetConnMaxLifetime(0) // don't kill connections due to age + sqldb.SetMaxOpenConns(1) // only 1 connection regardless of multiplier, see https://github.com/superseriousbusiness/gotosocial/issues/1407 + sqldb.SetMaxIdleConns(1) // only keep max 1 idle connection around + sqldb.SetConnMaxLifetime(0) // don't kill connections due to age // Wrap Bun database conn in our own wrapper conn := WrapDBConn(bun.NewDB(sqldb, sqlitedialect.New())) |