Question

Postgres Disk usage continuously increasing

Hello,

I noticed my postgres disk usage is continuously increasing wile nothing is connected. Can you help me to understand why ?

Thanks

Show comments

Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
October 3, 2023

Hi there,

I could suggest trying to narrow down which database and tables are using most of the disk space. You could use the following queries:

  • Check the size of a specific database:
SELECT pg_size_pretty(pg_database_size('defaultdb'));
  • Check the size of a specific table:
SELECT pg_size_pretty( pg_total_relation_size('table_name_here') );

In addition to what has already been mentioned, you can now add scalable storage to managed database clusters as shown in this video here:

Best,

Bobby

I’m facing the same challenge as well. Database gets maxxed out with little to no writes

KFSys
Site Moderator
Site Moderator badge
January 15, 2023

Hi @eatingceruleaneel,

Is it possible that you are writing data to your Postgresql from your application? There isn’t anything else that I can think of to be honest.

If this continuous, however, I’ll recommend contacting DigitalOcean’s Support, they can provide you with more information as they would have access to your instance.

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

card icon
Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Sign up
card icon
Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We’d like to help.

Learn more
card icon
Become a contributor

You get paid; we donate to tech nonprofits.

Learn more
Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow – whether you’re running one virtual machine or ten thousand.

Learn more ->
DigitalOcean Cloud Control Panel