Disk space usage by postgres

(Andrew Waugh) #1

On my sandbox install /var/discourse/shared/standalone/postgres_data is 31 G

On our live site this is only 17 G.

If anything, the sandbox db should be smaller (It was created from a backup back in January, and hasn’t had many new posts added).

Is this normal?

Completely Out of Disk Space
(Rafael dos Santos Silva) #2

Maybe the restore schema is still around somehow? Check that.

(Andrew Waugh) #3

I’d love to…


After I had created the sandbox and restored a backup from the live site I deleted quite a few categories. The backups have been fairly constant in size.

Why does my low activity install need 2GB RAM?
(Andrew Waugh) #4

To follow up on this, I just ran:

./launcher enter app
su - postgres
psql -U postgres discourse -c "DROP SCHEMA IF EXISTS backup CASCADE;"

Now “du -sh /var/discourse/shared/standalone/postgres_data/” shows the database as 17G, which is more in line with the live site.

What’s more is that after a “./launcher rebuild app” the site still works, despite my “hold my beer and watch this” approach to understanding postgres!

Disk Space Taken between Postgres and Docker
Creating a duplicate of production environment
Docker: 'system' is not a docker command. Unable to run ./launcher cleanup