Reported database size vs size in psql

Hi Folks,

Seeing quite a discrepancy between the database size reported under the Metrics tab and the database size reported by psql, so I wonder if I’m missing something.

The render dashboard says 905MB, and actually this has been steadily increasing:

This is odd given this is a test deployment of an open source service, it’s not really doing anything interesting :slight_smile:

I wanted to check what was taking up all the space, so I ran:

SELECT
    pg_database.datname,
    pg_size_pretty(pg_database_size(pg_database.datname)) AS size
    FROM pg_database;

The output shows the papercups database at 103MB:

  datname  |  size
-----------+---------
 postgres  | 7661 kB
 papercups | 103 MB
 template1 | 7521 kB
 template0 | 7521 kB

So I’m not sure what’s happening with the other 700MB? Does this include the size of backups perhaps?

Nik

Hello @nikz ,

The steadily increasing storage likely comes from database logs. We hold on to logs for seven days so we can debug issues that may arise with your database. This storage amount does fluctuate based on your usage patterns, but it should level off over time.

@Danielle thanks for that - is there any way for me to inspect or see what’s filling up those logs? The database doesn’t do much activity at all, so I’m surprised it’s so full!

Apologies if this is just me misunderstanding something about how Postgres works :slight_smile:

Hi @nikz,

We just recently provided support for database logs to appear in the dashboard but would have to enable it for you, which can incur a small amount of downtime. Let us know if that is something you would like us to do for you.

Ive found this problem in my databse.

@Tyler sure, I’ll reach out to the support email direct to get that done. Is that the best way for me to figure out what’s filling up the disk?