Jan Měkota
11/06/2025, 9:57 AMInstance class: db.t3.medium
vCPU: 2
RAM: 4 GB
Engine version: 13.18
but lately we have been having problems with SQL queries timeouts
Exception: Sequel::DatabaseError: PG::QueryCanceled: ERROR: canceling statement due to statement timeout
We are preparing to set up DB cleanup, but at the same time we are considering whether we should increase RDS resources.
Do you have any experience with what Instance class would be suitable?Matt (pactflow.io / pact-js / pact-go)
Jan Měkota
11/06/2025, 11:33 AMMartin Konir
11/06/2025, 12:34 PMMartin Konir
11/06/2025, 2:20 PMSequel::DatabaseError: PG::QueryCanceled: ERROR: canceling statement due to statement timeout (Sequel::DatabaseError)
CONTEXT: SQL statement "DELETE FROM ONLY "public"."latest_pact_publication_ids_for_consumer_versions" WHERE $1 OPERATOR(pg_catalog.=) "pact_version_id""
....
After that, we reduced the number of delete records to 1 - with the same result.
We tried doubling the `PACT_BROKER_DATABASE_STATEMENT_TIMEOUT`( to 30seconds)
but that resulted in different kind of errors:
Error reference TOzoMyNJIJ -- Exception: Sequel::PoolTimeout: timeout: 5.0
@Matt (pactflow.io / pact-js / pact-go) @Yousaf Nabi (pactflow.io) How can we resolve this situation? Do you have any recommendations? 🙏Yousaf Nabi (pactflow.io)
Matt (pactflow.io / pact-js / pact-go)
Currently we have 83 integrations
…
db size is 643MB (edited)ok, that’s not a huge roll out, we have customers with much larger data sets/magnitude. There are some queries that are highly dependent on data volumes. I think the clean will help, however we need to get over this hump first
Matt (pactflow.io / pact-js / pact-go)
Martin Konir
11/11/2025, 10:08 AMdatabaseInstanceType to db.t4g.large (we originally had db.t3.medium), but that didn’t help.
We managed to get the cleanup running with this config, thanks for your help thankyou
- name: PACT_BROKER_DATABASE_STATEMENT_TIMEOUT
value: '300000'
- name: PACT_BROKER_METRICS_SQL_STATEMENT_TIMEOUT
value: '600'
- name: PACT_BROKER_DATABASE_POOL_TIMEOUT
value: '360'
- name: PACT_BROKER_SQL_LOG_WARN_DURATION
value: '60'Matt (pactflow.io / pact-js / pact-go)
Jan Měkota
11/11/2025, 12:31 PM