Обсуждение: Disk usage

Поиск
Список
Период
Сортировка

Disk usage

От
"Jay O'Connor"
Дата:
I'm looking for any information I can find about how disk usage increases
as database volume increases.  Basically I'm converting a web site form a
homegrown file-based storage solution to a postgresql solution and I need
information on disk usage patterns for estimaing hardware needs.

Thanks
Jay


Re: Disk usage

От
Shridhar Daithankar
Дата:
On Wednesday 16 April 2003 07:11, Jay O'Connor wrote:
> I'm looking for any information I can find about how disk usage increases
> as database volume increases.  Basically I'm converting a web site form a
> homegrown file-based storage solution to a postgresql solution and I need
> information on disk usage patterns for estimaing hardware needs.

Disk space usage increases due to 2 or 3 factors.

1. You add data to database. There is nothing you can do about it.

2. You delete/update tuples, postgresql creates new versions of tuples and old
tuples are left around.

The dead tuples created due to update, can be reused using vacuum analyze,
which is relatively light wight and non-blocking operation.

To recover space from deleted tuples, you need to run vacuum full. This blocks
the table till vacuum is done.

3. Index growth. Dead tuples in index are not cleared with vacuum. You need to
reindex them periodically. Good news is, if you have enough space, you can do
inside a separate transaction, without affecting data visibility. But the
throughput may degrade due to load on disk bandwidth.

4. WAL. WAL files are created and reused. They do not grow beyond size set. So
for a default postgresql installation, 16MB-40MB disk space is always
consumed. But that is a worth of an investment IMO.

HTH

 Shridhar


Re: Disk usage

От
Richard Huxton
Дата:
On Wednesday 16 Apr 2003 2:41 am, Jay O'Connor wrote:
> I'm looking for any information I can find about how disk usage increases
> as database volume increases.  Basically I'm converting a web site form a
> homegrown file-based storage solution to a postgresql solution and I need
> information on disk usage patterns for estimaing hardware needs.

In addition to Shridhar's comments, take a look at Ch 11 of the Administrators
guide for some details on monitoring disk usage of tables etc.

Check the archives too, there's been discussion of calculating row sizes
several times (I thought there was something on techdocs about it, but can't
find it now).

--
  Richard Huxton