Re: How to cope with low disk space

Поиск
Список
Период
Сортировка
От Bill Moran
Тема Re: How to cope with low disk space
Дата
Msg-id 20080214150534.a3b6bbc0.wmoran@potentialtech.com
обсуждение исходный текст
Ответ на Re: How to cope with low disk space  (Michiel Holtkamp <michiel.holtkamp@soundintel.com>)
Список pgsql-general
In response to Michiel Holtkamp <michiel.holtkamp@soundintel.com>:

>
> On Feb 14, 2008, at 19:24 , Shane Ambler wrote:
> > Is postgresql the only thing using the disk space/partition?
>
> There are some other things on the partition, but they don't change
> in size.
>
> > Have you considered running a cron job to parse df output to
> > "trigger" a
> > delete when disk usage gets to a set threshold? and thus also account
> > for any unexpected non-postgresql disk usage.
>
> Yes, but this is not ideal:
>
> 1) sometimes we want a lot of data, just not that the disk runs out
> of free space
> 2) if you trigger on a disk space threshold only, you'll have to do a
> full vacuum and that gives problem in our application

Not necessarily.  let's say you trigger the cleanup job to run at 50%
used space, which is a pretty good place to start considering normal
operation is less than 5%.  At that point, if your run a normal vacuum,
40% or more of the space in the tables will be available for reuse.
Normal vacuum _will_ return _some_ disk space to the OS, but is not
nearly as aggressive as vacuum full is.  At that point, even if the
size of the tables on disk is 40% of the usable drive size, the amount
of space available in the tables will be 90% ore more, and the addition
of more data will reuse that unused space.

This _requires_ frequent vacuum, and accurate estimation of how quickly
you need to trigger the process.  It's probably going to take some
experimentation and babysitting on your part to get it right.

Were it me, I'd just add some hard drives to get the system up to about
1T of disk space.  If you can't get that budget, you'll have to be a
little more clever about it.

--
Bill Moran
http://www.potentialtech.com

В списке pgsql-general по дате отправления:

Предыдущее
От: Magnus Hagander
Дата:
Сообщение: Re: performance issues on windows with 8.3.0?
Следующее
От: Greg Smith
Дата:
Сообщение: Re: postgresql book - practical or something newer?