Twenty database connections on Postgres, and a panel that does not cry wolf (#199, #200)

The Database connections panel drew idle connections as their own line, which
sits on the max for ten minutes after any burst and read as the pool maxing out,
while at most two were ever in use. It now draws in use against the max, with
open dashed behind them. The pool itself goes from sqlx's ten to twenty: the
server allows 100 and had about 13 open across every app.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-11 20:27:21 +00:00
parent 8dc6dd4ce6
commit c28accb8e4
4 changed files with 16 additions and 10 deletions

View File

@@ -147,10 +147,16 @@ y += 8
# ---- Daemon, from Prometheus: what the daemon holds between requests (#194)
row("Daemon")
ts("Database connections", [prom('ipx_db_connections{job="ipx", state="in_use"}', legend="in use"),
prom('ipx_db_connections{job="ipx", state="idle"}', ref="B", legend="idle"),
prom('ipx_db_connections_max{job="ipx"}', ref="C", legend="most the pool opens")],
0, w=8, desc="In use reaching the most the pool opens means requests and scans are waiting for a connection.")
# Open connections stay open, idle, for ten minutes after a burst, so open at the max is not
# pressure; drawn as a line of its own it read as the pool maxing out (#199).
ts("Database connections", [prom('max(max_over_time(ipx_db_connections{job="ipx", state="in_use"}[$__interval]))', legend="in use"),
prom('sum(ipx_db_connections{job="ipx"})', ref="B", legend="open"),
prom('max(ipx_db_connections_max{job="ipx"})', ref="C", legend="most the pool opens")],
0, w=8, desc="In use reaching the most the pool opens means requests and scans are waiting for a connection. "
"Open connections stay open, idle, for ten minutes after a burst.")["fieldConfig"]["overrides"] = [
{"matcher": {"id": "byName", "options": "open"},
"properties": [{"id": "custom.lineStyle", "value": {"fill": "dash", "dash": [4, 4]}},
{"id": "custom.fillOpacity", "value": 0}, {"id": "color", "value": {"mode": "fixed", "fixedColor": "#8e8e8e"}}]}]
ts("Waiting", [prom('ipx_worker_queue{job="ipx"}', legend="commands for the worker"),
prom('ipx_runtime_queue{job="ipx"}', ref="B", legend="tasks for a thread"),
prom('ipx_downloads_pending{job="ipx"}', ref="C", legend="downloads")],