How to cope with low disk space

From: Michiel Holtkamp <michiel(dot)holtkamp(at)soundintel(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: How to cope with low disk space
Date: 2008-02-14 14:57:16
Message-ID: 47B456CC.10909@soundintel.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello list,

Just joined, read the archives, but couldn't find a solution to my
problem. My question is: 'How can I best determine when to delete
data?'. Hopefully this is the right place to ask, otherwise kindly
redirect me to the proper list.

The situation is as follows: we use PostgreSQL 8.1 to store large
amounts of data (we are talking GB's). This data is stored as large
objects and when we delete data, we don't forget to delete the
corresponding large objects as well. The data stored is deleted after a
while (usually a couple of weeks), so far so good.

Due to the nature of the information (sound data, recording triggered on
certain technical details) the amount of information is not very
predictable. Sometimes a lot of data is stored over a period of a few
days and the disk runs out of free space (this is not theoretical, in
one case it happened already). For this situation we decided that we
don't mind deleting some data earlier than normal, to ensure that we can
store newly generated data (newer data is more important than older data).

The problem:
Somehow we have to decide when to delete data earlier than normal. We
can't do this by checking disk-space, because postgres reserves
disk-space. Freeing disk-space can be done by doing a full vacuum, but
this locks tables and could cause data to be lost, besides I don't mind
that postgres reserves tables, it's more efficient anyway.

If anyone has ideas about this problem, it would be greatly appreciated,
I'm sure this is a problem encountered by more persons. I've already
looked at certain system tables (specifically pg_stat_user_tables) and
at docs like: http://www.postgresql.org/docs/8.1/static/diskusage.html
but so for no satisfying solution emerged.

Thanks,
Michiel Holtkamp

Responses

Browse pgsql-general by date

  From Date Subject
Next Message vincent 2008-02-14 15:05:55 Re: How to cope with low disk space
Previous Message Michael Fuhr 2008-02-14 14:57:08 Re: Order of SUBSTR and UPPER in statement