RDS reporting a lot more disk space than Postgresql

0

Hello,

My RDS instance (t2.medium running Postgresql) has been reporting a high drop in free disk space and I can't quite grasp why.
As you can see from the plot (RDS Free Disk Space over the last 4 weeks) below, it suddenly spiked around the 23rd April.
https://imgur.com/6KT6uDn.png
The spike seen on the 28th is a result of both increased disk allocation for the RDS instance and of purging around 100gb of data.

In fact, around the 23rd, we reprocessed a portion of the database (read up to 250GB from one table, and rewrote 24GB on another table, this process went on slowly for around 5 days). The process as since then stopped, but this rate continued.

I've confirmed in pg_stat_activity, that there's no additional inserts going on, so there's no application level process still inserting or updating data.
In fact, the sum of all database disk usage reported by Postgresql is around 675 GB (querying from pg_database_size and excluding rsadmin database, to which I have no access to by default), which is a bit off from what is being reported in the RDS dashboard (999GB allocated and 180GB free would be around 819GB)

What I get from this is that my RDS instance is getting less and less free space, but that space isn't being used by Postgresql? Or is it being used in a VACUUM operation that I can't see?

Appreciate any help, thanks in advance.

Edited by: jeanlucpicard on Apr 30, 2021 8:33 AM

asked 3 years ago1594 views
1 Answer
1

After following this guide https://aws.amazon.com/premiumsupport/knowledge-center/diskfull-error-rds-postgresql/, I was able to detect an inactive replication slot that was filling up this space that I reported.

Following the instructions in the link to list the replication slot and drop it with pg_drop_replication_slot(). The space was instantly released.

I'm still not sure why this replication slot popped up, but I figure it should be related to the heavy operations I was performing.

answered 3 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions