pg_stat_statements slows down the database
1
vote
1
answer
2945
views
I have an aws aurora postgresql cluster running posgresql 13.7 engine. The cluster is using the default parameter group.
These are the default settings used for pg_stat_statements in the parameter group (i use the default parameter group - this exact one, for other clusters as well).
Basically nothing is changed from the default values.
I use multiple glue jobs to write to this aurora cluster and I encounter an issue with the pg_stat_statement waits after a couple of runs.
If i do nothing about it, the cluster will automatically restart stating that the database processes have been killed due to the long runtime.
If i restart the cluster or if i use
Example run2 - LWLock:pg_stat_statements in yellow
I already adapted my glue jobs to be less stressful for the cluster by lowering the number of dpu's and implicitly running less parralel inserts into it.
Any ideas regarding where i should pick this up from are greatly appreciated.

SELECT pg_stat_statements_reset();
The pg_stat_statements view gets a reset and everything runs as it should.
Note: if the database gets restarted, right after restart i can run the same load (exactly the one that failed) with no issues.
Note2: I have another cluster with the same settings (size and parameter group), running the same type of jobs that does not manifest like this.
Example run1 - LWLock:pg_stat_statements in blue


Asked by mario
(13 rep)
Dec 12, 2022, 04:50 PM
Last activity: Mar 13, 2023, 04:00 AM
Last activity: Mar 13, 2023, 04:00 AM