summaryrefslogtreecommitdiffstats
path: root/internal/config/README.md
diff options
context:
space:
mode:
authorbndw <ben@bdw.to>2026-02-14 09:44:55 -0800
committerbndw <ben@bdw.to>2026-02-14 09:44:55 -0800
commitfe3708eaf495613cc6e2340b821795f25811d6ed (patch)
tree061f4b1c2938919ab38e0bc840c34d7c35bad42f /internal/config/README.md
parent688548d4ac3293449a88913275f886fd2e103cdf (diff)
fix: optimize SQLite connection pooling for single-writer architecture
Remove misleading max_connections config option and properly configure SQLite connection pooling in the storage layer. Changes: - Set MaxOpenConns(1) for optimal SQLite performance - Set MaxIdleConns(1) to keep connection alive - Set ConnMaxLifetime(0) to never close connection - Remove max_connections and max_lifetime from DatabaseConfig - Update docs to clarify SQLite's single-writer architecture Rationale: SQLite is an embedded database with a single-writer lock. Multiple connections cause lock contention and reduce performance. WAL mode allows concurrent reads from the same connection, making connection pooling unnecessary and counterproductive. This change makes the configuration clearer and ensures optimal SQLite performance by using a single long-lived connection.
Diffstat (limited to 'internal/config/README.md')
-rw-r--r--internal/config/README.md9
1 files changed, 2 insertions, 7 deletions
diff --git a/internal/config/README.md b/internal/config/README.md
index 87d6fa1..79e1b89 100644
--- a/internal/config/README.md
+++ b/internal/config/README.md
@@ -75,11 +75,8 @@ database:
75 # Path to SQLite database file 75 # Path to SQLite database file
76 path: "relay.db" 76 path: "relay.db"
77 77
78 # Maximum number of open connections 78 # Note: Connection pooling is automatically configured for SQLite.
79 max_connections: 10 79 # SQLite uses a single connection for optimal performance.
80
81 # Connection max lifetime
82 max_lifetime: "1h"
83 80
84# Authentication configuration 81# Authentication configuration
85auth: 82auth:
@@ -264,8 +261,6 @@ Server:
264 261
265Database: 262Database:
266 Path: "relay.db" 263 Path: "relay.db"
267 MaxConnections: 10
268 MaxLifetime: 1h
269 264
270Auth: 265Auth:
271 Enabled: false 266 Enabled: false