chore: release v0.20.7

This commit is contained in:
2026-07-21 18:26:34 +02:00
parent 828f99b8ac
commit 24a5a0480d
15 changed files with 909 additions and 183 deletions
+10 -6
View File
@@ -134,15 +134,19 @@ func translateTextColumns(s string) string {
// server's global max_connections — "Error 1040: Too many connections".
// - Too SMALL a pool starves this instance's OWN concurrent UI queries — the live
// multi-op sync (revision poll every 2s + a 3-query grid refresh), live_status,
// chat, stats, cluster — so the grid stops showing other operators' QSOs. (8 was
// too tight and reintroduced this "deadlock-like stall".)
// 16 is the balance: plenty for the UI's bursts, and ~15 ops still fit under a
// raised max_connections=300 (advise operators to raise it for a big multi-op).
// chat, stats, cluster. Under real multi-op load, 8 and even 16 stalled: hot
// paths (WorkedBefore fires ~10 sequential round-trips; every poll uses the
// app-lifetime ctx with no per-query timeout) hold a connection for the whole
// chain of remote-MySQL latency, so a handful of concurrent UI bursts drained
// the pool and "after a while nothing updated" — grid, chat, live_status froze.
// 40 fits the actual deployment (max 5 ops on a server with max_connections=300 →
// 40*5 = 200, leaving ~100 for phpMyAdmin/server overhead). This is the per-INSTANCE
// pool, so keep max_connections >= pool*ops + headroom.
// Brisk idle reaping returns slots to the server; no max lifetime so a slow first
// migration on one connection isn't reaped mid-run (drops the selected database).
func tuneMySQLPool(conn *sql.DB) {
conn.SetMaxOpenConns(16)
conn.SetMaxIdleConns(6)
conn.SetMaxOpenConns(40)
conn.SetMaxIdleConns(8)
conn.SetConnMaxIdleTime(30 * time.Second)
conn.SetConnMaxLifetime(0)
}