pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Database growth problem
5+ messages / 5 participants
[nested] [flat]

* Database growth problem
@ 2003-07-18 02:32 mlaks <mlaks@bellatlantic.net>
  2003-07-18 07:36 ` Re: Database growth problem Mendola Gaetano <mendola@bigfoot.com>
  2003-07-18 11:39 ` Re: Database growth problem Andrew Sullivan <andrew@libertyrms.info>
  2003-07-18 14:06 ` Re: Database growth problem scott.marlowe <scott.marlowe@ihs.com>
  0 siblings, 3 replies; 5+ messages in thread

From: mlaks @ 2003-07-18 02:32 UTC (permalink / raw)
  To: pgsql-admin

Hi,

 I have about 15 different PC's running RedHat 7.3 Linux, each running the 
same database backed application (I use  Postgresql 7.2.1 for the database) 
on each machine. 

The application essentially stores files on each of the PC's and the database 
on each machine stores information relevant to the files that are stored on 
that machine. 

The files themselves are stored on a RAID on each PC, around 300 GB in size. 
As each file is about .5MB in size, thus about 600,000 files are stored and 
managed by the Postgresql database on each machine. I note that the database 
is about 1GB in size on each of the machines.

I am constantly receiving new files, and as the PC's fill with files, I simply 
add additonal PC to my farm of PC's. 

These databases therefore never have any data deleted  from the databases. I 
just add files, and corresponding database entries each day, until I fill the 
machine with files. I run vacuum analyze on these databases about 3 times a 
day. 

I also keep one machine slightly different than the others. 

On this machine, as a backup to the other machines, instead of just storing  
files without deleting, I use a scheme that stores new files as they come in 
but also deletes the oldest files from the RAID and also deletes the 
corresponding entries describing those entries from the database. I use this 
machine as an element of redundancy to recent files on the other machines.

On this system, I keep the RAID about 75% full of files, and thus I imagine 
that the Postgresql database should be about .75 of a GB in size. However, it 
isnt! I find that it keeps growing as time goes on. Its now about 3.9GB in 
size! 

In fact, I just had to move the database to another partition on my system 
disk,  because it filled the var partition!

But I run vaccuum analyze at the same frequency as on the PC's? How is it that 
deleting and saving and vacuum analyze doesnt keep it at a normal svelte <1Gb 
in size?

What should  I do to shrink it back down to its normal svelte shape?

Thanks,
Mitchell



This way I have redundant copies of the most recent files that were stored on 
the other machines.





^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Database growth problem
  2003-07-18 02:32 Database growth problem mlaks <mlaks@bellatlantic.net>
@ 2003-07-18 07:36 ` Mendola Gaetano <mendola@bigfoot.com>
  2 siblings, 0 replies; 5+ messages in thread

From: Mendola Gaetano @ 2003-07-18 07:36 UTC (permalink / raw)
  To: mlaks <mlaks@bellatlantic.net>; pgsql-admin

"mlaks" <mlaks@bellatlantic.net> wrote:
> But I run vaccuum analyze at the same frequency as on the PC's? How is it
that
> deleting and saving and vacuum analyze doesnt keep it at a normal svelte
<1Gb
> in size?
>
> What should  I do to shrink it back down to its normal svelte shape?

Did you try to vacuum full and reindex the big tables ?

Regards
Gaetano
Mendola





^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Database growth problem
  2003-07-18 02:32 Database growth problem mlaks <mlaks@bellatlantic.net>
@ 2003-07-18 11:39 ` Andrew Sullivan <andrew@libertyrms.info>
  2 siblings, 0 replies; 5+ messages in thread

From: Andrew Sullivan @ 2003-07-18 11:39 UTC (permalink / raw)
  To: pgsql-admin

On Thu, Jul 17, 2003 at 10:32:24PM -0400, mlaks wrote:
> Hi,
> 
>  I have about 15 different PC's running RedHat 7.3 Linux, each running the 
> same database backed application (I use  Postgresql 7.2.1 for the database) 

Upgrade that to 7.2.4, at least.  Noo need to dump and restore, but
you get saved from some nasty bugs.

> On this system, I keep the RAID about 75% full of files, and thus I imagine 
> that the Postgresql database should be about .75 of a GB in size. However, it 
> isnt! I find that it keeps growing as time goes on. Its now about 3.9GB in 
> size! 

Could be that your free space map is too small; on 7.2, the default
is at least an order of magnitude too small.  Also, perhaps you need
to reindex: the btrees in Postgres have a nasty habit of growing
without bound.  (That's fixed in current CVS sources.)

A

-- 
----
Andrew Sullivan                         204-4141 Yonge Street
Liberty RMS                           Toronto, Ontario Canada
<andrew@libertyrms.info>                              M2P 2A8
                                         +1 416 646 3304 x110




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Database growth problem
  2003-07-18 02:32 Database growth problem mlaks <mlaks@bellatlantic.net>
@ 2003-07-18 14:06 ` scott.marlowe <scott.marlowe@ihs.com>
  2003-07-19 13:27   ` Re: Database growth problem Andrew Biagioni <andrew.biagioni@e-greek.net>
  2 siblings, 1 reply; 5+ messages in thread

From: scott.marlowe @ 2003-07-18 14:06 UTC (permalink / raw)
  To: mlaks <mlaks@bellatlantic.net>; +Cc: pgsql-admin

On Thu, 17 Jul 2003, mlaks wrote:

> Hi,
> 
>  I have about 15 different PC's running RedHat 7.3 Linux, each running the 
> same database backed application (I use  Postgresql 7.2.1 for the database) 
> on each machine. 

Upgrade to 7.2.4 as soon as possible.  There are bugs in 7.2.3 and before 
that can cause data loss.

> I also keep one machine slightly different than the others. 
> 
> On this machine, as a backup to the other machines, instead of just storing  
> files without deleting, I use a scheme that stores new files as they come in 
> but also deletes the oldest files from the RAID and also deletes the 
> corresponding entries describing those entries from the database. I use this 
> machine as an element of redundancy to recent files on the other machines.
> 
> On this system, I keep the RAID about 75% full of files, and thus I imagine 
> that the Postgresql database should be about .75 of a GB in size. However, it 
> isnt! I find that it keeps growing as time goes on. Its now about 3.9GB in 
> size! 

This sounds like index growth.  I'm guessing you're indexing on a field 
that only increments, and the btree is growing in one direction only.  
There's a fix in for 7.4 for this, but for now, all you likely need to do 
is reindex the index that keeps growing.

you can use oid2name (in /contrib/oid2name, easy install) and 'du -s' to 
figure out which files are the biggest and what they belong to.

cd $PGDATA/base
oid2name
cd oidfromlastcommand
du -s *|sort -n  #<- this will put the biggest at the bottom of the list
oid2name -d dbname |grep oid-from-previous-du-s 





^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Database growth problem
  2003-07-18 02:32 Database growth problem mlaks <mlaks@bellatlantic.net>
  2003-07-18 14:06 ` Re: Database growth problem scott.marlowe <scott.marlowe@ihs.com>
@ 2003-07-19 13:27   ` Andrew Biagioni <andrew.biagioni@e-greek.net>
  0 siblings, 0 replies; 5+ messages in thread

From: Andrew Biagioni @ 2003-07-19 13:27 UTC (permalink / raw)
  To: mlaks <mlaks@bellatlantic.net>; scott.marlowe <scott.marlowe@ihs.com>; +Cc: pgsql-admin

7/18/03 10:06:29 AM, "scott.marlowe" <scott.marlowe@ihs.com> wrote:

>On Thu, 17 Jul 2003, mlaks wrote:
>
>> Hi,
>> 
>>  I have about 15 different PC's running RedHat 7.3 Linux, each running the 
>> same database backed application (I use  Postgresql 7.2.1 for the database) 
>> on each machine. 
>
>Upgrade to 7.2.4 as soon as possible.  There are bugs in 7.2.3 and before 
>that can cause data loss.
>
>> I also keep one machine slightly different than the others. 
>> 
>> On this machine, as a backup to the other machines, instead of just storing  
>> files without deleting, I use a scheme that stores new files as they come in 
>> but also deletes the oldest files from the RAID and also deletes the 
>> corresponding entries describing those entries from the database. I use this 
>> machine as an element of redundancy to recent files on the other machines.
>> 
>> On this system, I keep the RAID about 75% full of files, and thus I imagine 
>> that the Postgresql database should be about .75 of a GB in size. However, 
it 
>> isnt! I find that it keeps growing as time goes on. Its now about 3.9GB in 
>> size! 
>
>This sounds like index growth.  I'm guessing you're indexing on a field 
>that only increments, and the btree is growing in one direction only.  
>There's a fix in for 7.4 for this, but for now, all you likely need to do 
>is reindex the index that keeps growing.

Just wondering ... Are you vacuuming the tables every now and then?  I 
certainly didn't find out about it right away...







^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2003-07-19 13:27 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-07-18 02:32 Database growth problem mlaks <mlaks@bellatlantic.net>
2003-07-18 07:36 ` Mendola Gaetano <mendola@bigfoot.com>
2003-07-18 11:39 ` Andrew Sullivan <andrew@libertyrms.info>
2003-07-18 14:06 ` scott.marlowe <scott.marlowe@ihs.com>
2003-07-19 13:27   ` Andrew Biagioni <andrew.biagioni@e-greek.net>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox