Idle connections
After updating to version CE v1.575.0, my prometheus started alert that the wdinmill instance have more than 100 postgres connections.
I don't know if this is related with the current version, so far everything still working properly
The query idle with more than 100 executions is:
WITH peek AS (
SELECT id
FROM v2_job_queue
WHERE running = false AND tag IN ('ansible', 'bash', 'bun', 'csharp', 'deno', 'dependency', 'duckdb', 'flow', 'go', 'hub', 'java', 'nu', 'other', 'php', 'powershell', 'python3', 'ruby', 'rust') AND scheduled_for <= now()
ORDER BY priority DESC NULLS LAST, scheduled_for
FOR UPDATE SKIP LOCKED
LIMIT 1
), q AS NOT MATERIALIZED (
UPDATE v2_job_queue SET
running = true,
started_at = coalesce(started_at, now()),
suspend_until = null,
worker = $1
WHERE id = (SELECT id FROM peek)
RETURNING
started_at, scheduled_for,
canceled_by, canceled_reason, worker
), r AS NOT MATERIALIZED (
UPDATE v2_job_runtime SET
ping = now()
WHERE id = (SELECT id FROM peek)
), j AS NOT MATERIALIZED (
SELECT
id, workspace_id, pa
0 Replies