Database
Hod needs Postgres 18 or newer, and refuses to start on an older one. Every server shares the same database.
-
Connections. Each server uses up to
HOD_DATABASE_MAX_CONNECTIONS, plus one for each background loop holding its lock (at most 7) and one that listens for notifications. Set Postgres'smax_connectionsto cover every server. -
Poolers. Hod listens for notifications (
LISTEN) and holds session advisory locks, so PgBouncer must run in session mode, or the server must connect to Postgres directly. Transaction pooling breaks both. -
Timeouts. Every connection has
statement_timeout,lock_timeoutand a one-minuteidle_in_transaction_session_timeout. Migrations run without them. Connections are namedhod-serverinpg_stat_activity. -
Health. Two queries show whether vacuum keeps up. The tables Hod updates often should show mostly HOT updates and few dead rows:
A
job_leaseswithn_tup_hot_updwell belown_tup_upd, orn_dead_tupgrowing between runs of autovacuum, points at a long-running transaction holding vacuum back (SELECT pid, xact_start, state, query FROM pg_stat_activity WHERE xact_start < now() - interval '5 minutes').