PostgreSQL Size increasing despite retention flag #9011
Replies: 5 comments
-
Retention job is known to be slow and there's not really a way to optimize it with the current schema. Deletes are just extremely slow in PostgreSQL without the use of partitions. Even if you delete, it doesn't mean that your cloud provider will shrink the storage. Google Cloud SQL does not reduce your volume size after deleting data. There are ways to reclaim it though. If you're saying the database itself and not just the volume is reporting a large size then maybe you need to vacuum some tables manually. |
Beta Was this translation helpful? Give feedback.
-
For some frequently utilized tables they are configured to auto vacuum more frequently than the default. Note auto vacuum will not free up disk space. Only full vacuum does so. |
Beta Was this translation helpful? Give feedback.
-
So the main concern is that the database used bytes size is increasing despite the retention job set to only keep 14 days worth of data. I could update the auto vacuum manually on some of these tables to run more frequently but would that help? Is there anything else I could try to prevent the database from increasing too much every day? |
Beta Was this translation helpful? Give feedback.
-
This is our current autovacuum setting for some tables: https://github.com/hashgraph/hedera-mirror-node/blob/main/hedera-mirror-importer/src/main/resources/db/migration/v1/R__autovacuum_insert_only_tables.sql Yes, you can try to vacuum them, especially, |
Beta Was this translation helpful? Give feedback.
-
Description
CloudSQL PostgreSQL database seems to be increasing every day despite having retention setup, pls find the helm chart config below:
We also have
importer.config.hedera.mirror.importer.startDate
set up of value2024-07-15T00:00:00.000000000Z
If I check the logs for RetentionJob I can see it's running fine but takes 16 hours to complete... I checked last 7 days and all retention jobs take anywhere from 10 to 17 hours to complete.
The node is deployed on a GCP kubernetes cluster with node pool having instance type
n1-standard-4
and the cloudSQL database is usingdb-custom-4-15360
instanceSteps to reproduce
Added helm chart value above for importer and details for the instance types.
Additional context
Here is a screenshot of last 7 day metrics of the database.
Hedera network
mainnet
Version
0.109.0
Operating system
Linux
Beta Was this translation helpful? Give feedback.
All reactions