Skip to content

Set PostgreSQL idle in transaction session timeout in deploy profile - #3600

Open
richturner wants to merge 1 commit into
mainfrom
enhancement/db_idle_in_transaction_timeout
Open

richturner wants to merge 1 commit into
mainfrom
enhancement/db_idle_in_transaction_timeout

Conversation

@richturner

Copy link
Copy Markdown
Member

Description

Passes POSTGRES_IDLE_IN_TRANSACTION_SESSION_TIMEOUT (default 10min, 0 disables) to the postgresql service in profile/deploy.yml, next to POSTGRES_MAX_CONNECTIONS.

Sessions left idle in a transaction prevent autovacuum removing dead rows. On a production instance this bloated the openremote.asset heap to 177 MB for about 2,900 rows (3.7 MB after VACUUM FULL). The timeout terminates such sessions before they cause bloat.

Depends on

Related

Checklist

  • 1. Acceptance criteria of the linked issue(s) are met
  • 2. Tests are written and all tests pass
  • 3. Changes are manually tested by you and the reviewer
  • 4. Documentation is written or updated

Pass POSTGRES_IDLE_IN_TRANSACTION_SESSION_TIMEOUT (default 10min) to the
postgresql service so sessions left idle in a transaction are terminated
before they can prevent autovacuum removing dead rows. Requires an
openremote/postgresql image that supports the variable; older images
ignore it.
@sonarqubecloud

Copy link
Copy Markdown

@richturner richturner self-assigned this Nov 20, 2026
@richturner
richturner requested a review from a team November 20, 2026 12:02

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant