pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Table space grow big - PostgreSQL
14+ messages / 7 participants
[nested] [flat]

* Table space grow big - PostgreSQL
@ 2010-05-05 11:36  Khangelani Gama <Khangelani.Gama@ucs-software.co.za>
  0 siblings, 2 replies; 14+ messages in thread

From: Khangelani Gama @ 2010-05-05 11:36 UTC (permalink / raw)
  To: pgsql-admin

Hi all


Please assist on this scenario, I am a junior DBA, perhaps the question I have is too simple please bear with me.


I have a server with one PostgreSQL database and the data reside in /usr/local/pgsql/data/ running on Redhat 9 O/S.

File system looks as follows:

Filesystem            Size  Used Avail Use% Mounted on
/dev/hda3              73G   61G  8.7G  88% /
/dev/hda1              99M   63M   32M  67% /boot
none                  441M     0  441M   0% /dev/shm


Disc space utilization looks as follows where the data/ directory seems to be taking a lot of space compared to any other directories:

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

* Re: Table space grow big - PostgreSQL
@ 2010-05-05 11:42  Brett Parker <iDunno@sommitrealweird.co.uk>
  parent: Khangelani Gama <Khangelani.Gama@ucs-software.co.za>
  1 sibling, 1 reply; 14+ messages in thread

From: Brett Parker @ 2010-05-05 11:42 UTC (permalink / raw)
  To: pgsql-admin

On 05 May 13:36, Khangelani Gama wrote:
> Hi all
> 
> 
> Please assist on this scenario, I am a junior DBA, perhaps the
> question I have is too simple please bear with me.
> 
> I have a server with one PostgreSQL database and the data reside in
> /usr/local/pgsql/data/ running on Redhat 9 O/S.

<snippage class="lots" />
 
> The main question I have is: What makes the
> /usr/local/pgsql/data/base/95186722/  grow so big while the actual
> data with its schema is only 2.8G and that is there a way to reduce
> the table space sizes or anything related to that?

OK - what version of postgres would be a good starting question...

But, at a guess, I'd say you have a fair amount of table churn, and that
you're probably due running a VACUUM FULL over the database that is
using the most space, it may fail, but if it does it should tell you
what bit of config you'll need to change to make it work.

The other possible usage of lots of space is indexes on the database
tables, these are not included in the dump, and so the size of the dump
doesn't accurately reflect the size of the on disc data.

Hope that gives you somewhere to start from.

Thanks,
-- 
Brett Parker



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

* Re: Table space grow big - PostgreSQL
@ 2010-05-05 11:45  Kevin Grittner <Kevin.Grittner@wicourts.gov>
  0 siblings, 1 reply; 14+ messages in thread

From: Kevin Grittner @ 2010-05-05 11:45 UTC (permalink / raw)
  To: pgsql-admin; Khangelani.Gama@ucs-software.co.za

Khangelani Gama  wrote:
 
> /usr/local/pgsql/data/base directory shows the following where
> 95186722/ takes a lot of space :

> 51G ./95186722

> Now the dump file of the very same database created by using
> command : pg_dump -U user -O dbname > /tmp/filename is 2.8G big.
 
> The main question I have is: What makes the
> /usr/local/pgsql/data/base/95186722/ grow so big while the actual
> data with its schema is only 2.8G and that is there a way to reduce
> the table space sizes or anything related to that?
 
The size of a dump is often somewhat smaller than the raw data, but
this extreme difference suggests that your tables are bloated due to
inadequate routine maintenance.  What version of PostgreSQL is this? 
What is your vacuum policy?  Please show the contents of your
postgresql.conf file with all comments stripped.
 
-Kevin




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

* Re: Table space grow big - PostgreSQL
@ 2010-05-05 11:47  Devrim GÜNDÜZ <devrim@gunduz.org>
  parent: Khangelani Gama <Khangelani.Gama@ucs-software.co.za>
  1 sibling, 0 replies; 14+ messages in thread

From: Devrim GÜNDÜZ @ 2010-05-05 11:47 UTC (permalink / raw)
  To: Khangelani Gama <Khangelani.Gama@ucs-software.co.za>; +Cc: pgsql-admin

On Wed, 2010-05-05 at 13:36 +0200, Khangelani Gama wrote:
> The main question I have is: What makes
> the /usr/local/pgsql/data/base/95186722/  grow so big while the actual
> data with its schema is only 2.8G and that is there a way to reduce
> the table space sizes or anything related to that?

Which PostgreSQL version is this? I'm assuming it is an old one, since
you are running Red Hat 9. 

Have you vacuumed it recently/regularly? If not, dead space (space that
is consumed by dead tuples) will consume lots of disk space, until they
are vacuumed. However, If you haven't vacuumed for a long time, it may
be the best to dump/restore the database, and then apply regular
maintenance:

http://www.postgresql.org/docs/current/static/maintenance.html

Regards, 
-- 
Devrim GÜNDÜZ
PostgreSQL Danışmanı/Consultant, Red Hat Certified Engineer
PostgreSQL RPM Repository: http://yum.pgrpms.org
Community: devrim~PostgreSQL.org, devrim.gunduz~linux.org.tr
http://www.gunduz.org  Twitter: http://twitter.com/devrimgunduz

Attachments:

  signature.asc (application/pgp-signature, 197B) download

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

* Re: Table space grow big - PostgreSQL
@ 2010-05-05 12:01  Achilleas Mantzios <achill@matrix.gatewaynet.com>
  parent: Kevin Grittner <Kevin.Grittner@wicourts.gov>
  0 siblings, 0 replies; 14+ messages in thread

From: Achilleas Mantzios @ 2010-05-05 12:01 UTC (permalink / raw)
  To: pgsql-admin

Στις Wednesday 05 May 2010 14:45:26 ο/η Kevin Grittner έγραψε:
> Khangelani Gama  wrote:
>  
> > /usr/local/pgsql/data/base directory shows the following where
> > 95186722/ takes a lot of space :
> 
> > 51G ./95186722
> 
> > Now the dump file of the very same database created by using
> > command : pg_dump -U user -O dbname > /tmp/filename is 2.8G big.
>  
> > The main question I have is: What makes the
> > /usr/local/pgsql/data/base/95186722/ grow so big while the actual
> > data with its schema is only 2.8G and that is there a way to reduce
> > the table space sizes or anything related to that?
>  
> The size of a dump is often somewhat smaller than the raw data, but
> this extreme difference suggests that your tables are bloated due to
> inadequate routine maintenance.  What version of PostgreSQL is this? 
> What is your vacuum policy?  Please show the contents of your
> postgresql.conf file with all comments stripped.
>  

It depends, in the case of indexes, one SQL CREATE INDEX statement could result to many megs of memory on disk,
while, on the other hand, binary content (a bytea holding e.g. image bitmaps) will have bigger size in the dump rather than
on disk's raw data, since it is compressed there.
In our case the dump is twice the size of the db on disk, but generally i think there cant be no universal rule of what is
larger than what.

> -Kevin
> 
> 



-- 
Achilleas Mantzios



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

* Re: Table space grow big - PostgreSQL
@ 2010-05-05 13:42  Khangelani Gama <Khangelani.Gama@ucs-software.co.za>
  parent: Brett Parker <iDunno@sommitrealweird.co.uk>
  0 siblings, 3 replies; 14+ messages in thread

From: Khangelani Gama @ 2010-05-05 13:42 UTC (permalink / raw)
  To: pgsql-admin

Many Thanks for all the replies.


The conversion project to version 8 is still in progress, hence we are still experiencing problems on a version that's not supported. That's an honest answer I can give. The thing is it's frustrating to not to have a source of support as we still have to give support on this version 7.3.4


There is a script that runs once a month which reindex, vacuum full verborse and vacuum analyze :

Small picture inside the script:

        echo "VACUUMING TABLE ${table} " >>$log 2>>$log
        /usr/local/pgsql/bin/psql -U $dbuser -h localhost ${db} -tc "REINDEX TABLE ${table}" >>$log 2>>$log
        /usr/local/pgsql/bin/psql -U $dbuser -h localhost ${db} -tc "VACUUM FULL VERBOSE ${table}" >>$log  2>>$log
        /usr/local/pgsql/bin/psql -U $dbuser -h localhost ${db} -tc "VACUUM ANALYZE ${table}" >>$log  2>>$log


Dumping and restoring the database doesn't decrease the space



There is nothing set in the postgresql.conf file that has to do with vacuum analyze.

If we could have a way to reduce the space in /usr/local/pgsql/data/base/95186722 directory we would be sorted








-----Original Message-----
From: pgsql-admin-owner@postgresql.org [mailto:pgsql-admin-owner@postgresql.org] On Behalf Of Brett Parker
Sent: Wednesday, May 05, 2010 1:42 PM
To: pgsql-admin@postgresql.org
Subject: Re: [ADMIN] Table space grow big - PostgreSQL

On 05 May 13:36, Khangelani Gama wrote:
> Hi all
>
>
> Please assist on this scenario, I am a junior DBA, perhaps the
> question I have is too simple please bear with me.
>
> I have a server with one PostgreSQL database and the data reside in
> /usr/local/pgsql/data/ running on Redhat 9 O/S.

<snippage class="lots" />

> The main question I have is: What makes the
> /usr/local/pgsql/data/base/95186722/  grow so big while the actual
> data with its schema is only 2.8G and that is there a way to reduce
> the table space sizes or anything related to that?

OK - what version of postgres would be a good starting question...

But, at a guess, I'd say you have a fair amount of table churn, and that
you're probably due running a VACUUM FULL over the database that is
using the most space, it may fail, but if it does it should tell you
what bit of config you'll need to change to make it work.

The other possible usage of lots of space is indexes on the database
tables, these are not included in the dump, and so the size of the dump
doesn't accurately reflect the size of the on disc data.

Hope that gives you somewhere to start from.

Thanks,
--
Brett Parker

--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

The contents of and attachments to this e-mail are intended for the addressee only, and may contain the confidential information of UCS Group and/or its subsidiaries.  Any review, use or dissemination thereof by anyone other than the intended addressee is prohibited.  If you are not the intended addressee please notify the writer immediately and destroy the e-mail.  UCS Group Limited and its subsidiaries distance themselves from and accept no liability for unauthorised use of their e-mail facilities or e-mails sent other than strictly for business purposes.



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

* Re: Table space grow big - PostgreSQL
@ 2010-05-05 13:54  Iñigo Martinez Lasala <imartinez@vectorsf.com>
  parent: Khangelani Gama <Khangelani.Gama@ucs-software.co.za>
  2 siblings, 0 replies; 14+ messages in thread

From: Iñigo Martinez Lasala @ 2010-05-05 13:54 UTC (permalink / raw)
  To: Khangelani Gama <Khangelani.Gama@ucs-software.co.za>; +Cc: pgsql-admin

What about "vacuumdb -azf -U postgres"? (or for each database, "VACUUM
FULL")

With that script you only vacuum specific tables, but not entire
databases.

vacuum analyze should also be launched more frequently. Perhaps once a
day, if possible, or sooner.
"vacuumdb -az -U postgres" (or for each database, "VACUUM ANALYZE"

-----Original Message-----
From: Khangelani Gama <Khangelani.Gama@ucs-software.co.za>
To: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>
Subject: Re: [ADMIN] Table space grow big - PostgreSQL
Date: Wed, 5 May 2010 15:42:00 +0200


Many Thanks for all the replies.


The conversion project to version 8 is still in progress, hence we are still experiencing problems on a version that's not supported. That's an honest answer I can give. The thing is it's frustrating to not to have a source of support as we still have to give support on this version 7.3.4


There is a script that runs once a month which reindex, vacuum full verborse and vacuum analyze :

Small picture inside the script:

        echo "VACUUMING TABLE ${table} " >>$log 2>>$log
        /usr/local/pgsql/bin/psql -U $dbuser -h localhost ${db} -tc "REINDEX TABLE ${table}" >>$log 2>>$log
        /usr/local/pgsql/bin/psql -U $dbuser -h localhost ${db} -tc "VACUUM FULL VERBOSE ${table}" >>$log  2>>$log
        /usr/local/pgsql/bin/psql -U $dbuser -h localhost ${db} -tc "VACUUM ANALYZE ${table}" >>$log  2>>$log


Dumping and restoring the database doesn't decrease the space



There is nothing set in the postgresql.conf file that has to do with vacuum analyze.

If we could have a way to reduce the space in /usr/local/pgsql/data/base/95186722 directory we would be sorted








-----Original Message-----
From: pgsql-admin-owner@postgresql.org [mailto:pgsql-admin-owner@postgresql.org] On Behalf Of Brett Parker
Sent: Wednesday, May 05, 2010 1:42 PM
To: pgsql-admin@postgresql.org
Subject: Re: [ADMIN] Table space grow big - PostgreSQL

On 05 May 13:36, Khangelani Gama wrote:
> Hi all
>
>
> Please assist on this scenario, I am a junior DBA, perhaps the
> question I have is too simple please bear with me.
>
> I have a server with one PostgreSQL database and the data reside in
> /usr/local/pgsql/data/ running on Redhat 9 O/S.

<snippage class="lots" />

> The main question I have is: What makes the
> /usr/local/pgsql/data/base/95186722/  grow so big while the actual
> data with its schema is only 2.8G and that is there a way to reduce
> the table space sizes or anything related to that?

OK - what version of postgres would be a good starting question...

But, at a guess, I'd say you have a fair amount of table churn, and that
you're probably due running a VACUUM FULL over the database that is
using the most space, it may fail, but if it does it should tell you
what bit of config you'll need to change to make it work.

The other possible usage of lots of space is indexes on the database
tables, these are not included in the dump, and so the size of the dump
doesn't accurately reflect the size of the on disc data.

Hope that gives you somewhere to start from.

Thanks,
--
Brett Parker

--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

The contents of and attachments to this e-mail are intended for the addressee only, and may contain the confidential information of UCS Group and/or its subsidiaries.  Any review, use or dissemination thereof by anyone other than the intended addressee is prohibited.  If you are not the intended addressee please notify the writer immediately and destroy the e-mail.  UCS Group Limited and its subsidiaries distance themselves from and accept no liability for unauthorised use of their e-mail facilities or e-mails sent other than strictly for business purposes.

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

* Re: Table space grow big - PostgreSQL
@ 2010-05-05 13:54  Ian Lea <ian.lea@gmail.com>
  parent: Khangelani Gama <Khangelani.Gama@ucs-software.co.za>
  2 siblings, 0 replies; 14+ messages in thread

From: Ian Lea @ 2010-05-05 13:54 UTC (permalink / raw)
  To: Khangelani Gama <Khangelani.Gama@ucs-software.co.za>; +Cc: pgsql-admin

In your original email I think you showed a directory that held
something like 50Gb of files with a listing of that directory that
added up to something much smaller.  If that is right - what else is
in that directory?

Does your monthly vacuum script work?


--
Ian.


On Wed, May 5, 2010 at 2:42 PM, Khangelani Gama
<Khangelani.Gama@ucs-software.co.za> wrote:
> Many Thanks for all the replies.
>
>
> The conversion project to version 8 is still in progress, hence we are still experiencing problems on a version that's not supported. That's an honest answer I can give. The thing is it's frustrating to not to have a source of support as we still have to give support on this version 7.3.4
>
>
> There is a script that runs once a month which reindex, vacuum full verborse and vacuum analyze :
>
> Small picture inside the script:
>
>        echo "VACUUMING TABLE ${table} " >>$log 2>>$log
>        /usr/local/pgsql/bin/psql -U $dbuser -h localhost ${db} -tc "REINDEX TABLE ${table}" >>$log 2>>$log
>        /usr/local/pgsql/bin/psql -U $dbuser -h localhost ${db} -tc "VACUUM FULL VERBOSE ${table}" >>$log  2>>$log
>        /usr/local/pgsql/bin/psql -U $dbuser -h localhost ${db} -tc "VACUUM ANALYZE ${table}" >>$log  2>>$log
>
>
> Dumping and restoring the database doesn't decrease the space
>
>
>
> There is nothing set in the postgresql.conf file that has to do with vacuum analyze.
>
> If we could have a way to reduce the space in /usr/local/pgsql/data/base/95186722 directory we would be sorted
>
>
>
>
>
>
>
>
> -----Original Message-----
> From: pgsql-admin-owner@postgresql.org [mailto:pgsql-admin-owner@postgresql.org] On Behalf Of Brett Parker
> Sent: Wednesday, May 05, 2010 1:42 PM
> To: pgsql-admin@postgresql.org
> Subject: Re: [ADMIN] Table space grow big - PostgreSQL
>
> On 05 May 13:36, Khangelani Gama wrote:
>> Hi all
>>
>>
>> Please assist on this scenario, I am a junior DBA, perhaps the
>> question I have is too simple please bear with me.
>>
>> I have a server with one PostgreSQL database and the data reside in
>> /usr/local/pgsql/data/ running on Redhat 9 O/S.
>
> <snippage class="lots" />
>
>> The main question I have is: What makes the
>> /usr/local/pgsql/data/base/95186722/  grow so big while the actual
>> data with its schema is only 2.8G and that is there a way to reduce
>> the table space sizes or anything related to that?
>
> OK - what version of postgres would be a good starting question...
>
> But, at a guess, I'd say you have a fair amount of table churn, and that
> you're probably due running a VACUUM FULL over the database that is
> using the most space, it may fail, but if it does it should tell you
> what bit of config you'll need to change to make it work.
>
> The other possible usage of lots of space is indexes on the database
> tables, these are not included in the dump, and so the size of the dump
> doesn't accurately reflect the size of the on disc data.
>
> Hope that gives you somewhere to start from.
>
> Thanks,
> --
> Brett Parker
>
> --
> Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-admin
>
> The contents of and attachments to this e-mail are intended for the addressee only, and may contain the confidential information of UCS Group and/or its subsidiaries.  Any review, use or dissemination thereof by anyone other than the intended addressee is prohibited.  If you are not the intended addressee please notify the writer immediately and destroy the e-mail.  UCS Group Limited and its subsidiaries distance themselves from and accept no liability for unauthorised use of their e-mail facilities or e-mails sent other than strictly for business purposes.
>
> --
> Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-admin
>



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

* Re: Table space grow big - PostgreSQL
@ 2010-05-05 13:59  Kevin Grittner <Kevin.Grittner@wicourts.gov>
  parent: Khangelani Gama <Khangelani.Gama@ucs-software.co.za>
  2 siblings, 1 reply; 14+ messages in thread

From: Kevin Grittner @ 2010-05-05 13:59 UTC (permalink / raw)
  To: pgsql-admin; Khangelani Gama <Khangelani.Gama@ucs-software.co.za>

Khangelani Gama <Khangelani.Gama@ucs-software.co.za> wrote:
 
> There is a script that runs once a month
 
Most likely that should be daily, or at least weekly.
 
> "REINDEX TABLE ${table}"
> "VACUUM FULL VERBOSE ${table}"
> "VACUUM ANALYZE ${table}"
 
That's the wrong order.  Try:
 
"VACUUM FULL VERBOSE ANALYZE ${table}"
"REINDEX TABLE ${table}"
 
With your current order, the VACUUM FULL bloats the indexes you've
just rebuilt.
 
If you vacuum frequently enough, you should not need to use the FULL
option.
 
> Dumping and restoring the database doesn't decrease the space
 
Now, that's odd.  You're not restoring back into the same database
without dropping it first (using the "clean" option), are you? 
Perhaps you have some very wide indexes, or a very large number of
small tables?
 
> There is nothing set in the postgresql.conf file that has to do
> with vacuum analyze.
 
Well, that wasn't the only thing I would look for; however, I'm not
sure how many of the things I usually check exist in 7.3 or work the
same way.  :-(
 
-Kevin



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

* Re: Table space grow big - PostgreSQL
@ 2010-05-06 06:33  Khangelani Gama <Khangelani.Gama@ucs-software.co.za>
  parent: Kevin Grittner <Kevin.Grittner@wicourts.gov>
  0 siblings, 1 reply; 14+ messages in thread

From: Khangelani Gama @ 2010-05-06 06:33 UTC (permalink / raw)
  To: pgsql-admin; +Cc: Nico Botha <Nico.Botha@ucs-software.co.za>; Quintin Hoare <Quintin.Hoare@ucs-software.co.za>; Melanie Diedericks <Melanie.Diedericks@ucs-software.co.za>

Thanks again for the replies:


Responding to Kevin, Ian, and Inigo:



1. We'll try an change the order in the script
2. Daily vacuum analyze was disabled, which was running from a different script, we'll try to put it back.
3. The monthly script does work.
4. In my original email about the directory that takes more space:

/usr/local/pgsql/data/base directory shows the following where 95186722/ takes a lot of space  :

3.6M    ./1
3.6M    ./16975
51G     ./95186722
4.8M    ./4830693
51G     .



There is nothing else in /usr/local/pgsql/data/base/95186722/  directory except the table space names with different spaces for each one of them. And in other servers these table space sizes are now at 1.0G, for an example there is about 15 of them which makes about 15G.

-rw-------    1 postgres postgres      16K May  5 12:50 219436402
-rw-------    1 postgres postgres      16K May  5 12:50 219436401
-rw-------    1 postgres postgres      16K May  5 12:50 219436400
-rw-------    1 postgres postgres      16K May  5 12:50 219436399
-rw-------    1 postgres postgres      34M May  5 12:50 219436274
-rw-------    1 postgres postgres      42M May  5 12:50 219436273
-rw-------    1 postgres postgres      43M May  5 12:50 219436272
-rw-------    1 postgres postgres      42M May  5 12:50 219436271
-rw-------    1 postgres postgres      34M May  5 12:50 219436270
-rw-------    1 postgres postgres      42M May  5 12:50 219436269
-rw-------    1 postgres postgres      42M May  5 12:50 219436268
-rw-------    1 postgres postgres      51M May  5 12:50 219436267
-rw-------    1 postgres postgres      34M May  5 12:50 219436266
-rw-------    1 postgres postgres      51M May  5 12:50 219436265
-rw-------    1 postgres postgres      15M May  5 12:50 218478745
-rw-------    1 postgres postgres      11M May  5 12:50 218478744
-rw-------    1 postgres postgres      10M May  5 12:50 218478743
-rw-------    1 postgres postgres      13M May  5 12:50 218478742
-rw-------    1 postgres postgres     440M May  5 12:50 216081969.1












-----Original Message-----
From: Kevin Grittner [mailto:Kevin.Grittner@wicourts.gov]
Sent: Wednesday, May 05, 2010 3:59 PM
To: pgsql-admin@postgresql.org; Khangelani Gama
Subject: Re: [ADMIN] Table space grow big - PostgreSQL

Khangelani Gama <Khangelani.Gama@ucs-software.co.za> wrote:

> There is a script that runs once a month

Most likely that should be daily, or at least weekly.

> "REINDEX TABLE ${table}"
> "VACUUM FULL VERBOSE ${table}"
> "VACUUM ANALYZE ${table}"

That's the wrong order.  Try:

"VACUUM FULL VERBOSE ANALYZE ${table}"
"REINDEX TABLE ${table}"

With your current order, the VACUUM FULL bloats the indexes you've
just rebuilt.

If you vacuum frequently enough, you should not need to use the FULL
option.

> Dumping and restoring the database doesn't decrease the space

Now, that's odd.  You're not restoring back into the same database
without dropping it first (using the "clean" option), are you?
Perhaps you have some very wide indexes, or a very large number of
small tables?

> There is nothing set in the postgresql.conf file that has to do
> with vacuum analyze.

Well, that wasn't the only thing I would look for; however, I'm not
sure how many of the things I usually check exist in 7.3 or work the
same way.  :-(

-Kevin

The contents of and attachments to this e-mail are intended for the addressee only, and may contain the confidential information of UCS Group and/or its subsidiaries.  Any review, use or dissemination thereof by anyone other than the intended addressee is prohibited.  If you are not the intended addressee please notify the writer immediately and destroy the e-mail.  UCS Group Limited and its subsidiaries distance themselves from and accept no liability for unauthorised use of their e-mail facilities or e-mails sent other than strictly for business purposes.



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

* Re: Table space grow big - PostgreSQL
@ 2010-05-06 08:49  Ian Lea <ian.lea@gmail.com>
  parent: Khangelani Gama <Khangelani.Gama@ucs-software.co.za>
  0 siblings, 2 replies; 14+ messages in thread

From: Ian Lea @ 2010-05-06 08:49 UTC (permalink / raw)
  To: Khangelani Gama <Khangelani.Gama@ucs-software.co.za>; +Cc: pgsql-admin

I'm still confused about the disk space, even more so now that more
servers and figures of 1Gb and 15Gb have joined the party.

Presumably this:

> 3.6M    ./1
> 3.6M    ./16975
> 51G     ./95186722
> 4.8M    ./4830693
> 51G     .

is the output from some $ du command.  And is this

> -rw-------    1 postgres postgres      16K May  5 12:50 219436402
> -rw-------    1 postgres postgres      16K May  5 12:50 219436401
> -rw-------    1 postgres postgres      16K May  5 12:50 219436400
> -rw-------    1 postgres postgres      16K May  5 12:50 219436399
> -rw-------    1 postgres postgres      34M May  5 12:50 219436274
> -rw-------    1 postgres postgres      42M May  5 12:50 219436273
> -rw-------    1 postgres postgres      43M May  5 12:50 219436272
> -rw-------    1 postgres postgres      42M May  5 12:50 219436271
> -rw-------    1 postgres postgres      34M May  5 12:50 219436270
> -rw-------    1 postgres postgres      42M May  5 12:50 219436269
> -rw-------    1 postgres postgres      42M May  5 12:50 219436268
> -rw-------    1 postgres postgres      51M May  5 12:50 219436267
> -rw-------    1 postgres postgres      34M May  5 12:50 219436266
> -rw-------    1 postgres postgres      51M May  5 12:50 219436265
> -rw-------    1 postgres postgres      15M May  5 12:50 218478745
> -rw-------    1 postgres postgres      11M May  5 12:50 218478744
> -rw-------    1 postgres postgres      10M May  5 12:50 218478743
> -rw-------    1 postgres postgres      13M May  5 12:50 218478742
> -rw-------    1 postgres postgres     440M May  5 12:50 216081969.1

the output from some $ ls command on
/usr/local/pgsql/data/base/95186722?  You say there is nothing else in
that directory, but those sizes don't add up to 51Gb so something is
messed up somewhere.

Maybe this is nothing to do with postgres and a reboot and/or fsck of
the disk will fix everything.


--
Ian.


On Thu, May 6, 2010 at 7:33 AM, Khangelani Gama
<Khangelani.Gama@ucs-software.co.za> wrote:
> Thanks again for the replies:
>
>
> Responding to Kevin, Ian, and Inigo:
>
>
>
> 1. We'll try an change the order in the script
> 2. Daily vacuum analyze was disabled, which was running from a different script, we'll try to put it back.
> 3. The monthly script does work.
> 4. In my original email about the directory that takes more space:
>
> /usr/local/pgsql/data/base directory shows the following where 95186722/ takes a lot of space  :
>
> 3.6M    ./1
> 3.6M    ./16975
> 51G     ./95186722
> 4.8M    ./4830693
> 51G     .
>
>
>
> There is nothing else in /usr/local/pgsql/data/base/95186722/  directory except the table space names with different spaces for each one of them. And in other servers these table space sizes are now at 1.0G, for an example there is about 15 of them which makes about 15G.
>
> -rw-------    1 postgres postgres      16K May  5 12:50 219436402
> -rw-------    1 postgres postgres      16K May  5 12:50 219436401
> -rw-------    1 postgres postgres      16K May  5 12:50 219436400
> -rw-------    1 postgres postgres      16K May  5 12:50 219436399
> -rw-------    1 postgres postgres      34M May  5 12:50 219436274
> -rw-------    1 postgres postgres      42M May  5 12:50 219436273
> -rw-------    1 postgres postgres      43M May  5 12:50 219436272
> -rw-------    1 postgres postgres      42M May  5 12:50 219436271
> -rw-------    1 postgres postgres      34M May  5 12:50 219436270
> -rw-------    1 postgres postgres      42M May  5 12:50 219436269
> -rw-------    1 postgres postgres      42M May  5 12:50 219436268
> -rw-------    1 postgres postgres      51M May  5 12:50 219436267
> -rw-------    1 postgres postgres      34M May  5 12:50 219436266
> -rw-------    1 postgres postgres      51M May  5 12:50 219436265
> -rw-------    1 postgres postgres      15M May  5 12:50 218478745
> -rw-------    1 postgres postgres      11M May  5 12:50 218478744
> -rw-------    1 postgres postgres      10M May  5 12:50 218478743
> -rw-------    1 postgres postgres      13M May  5 12:50 218478742
> -rw-------    1 postgres postgres     440M May  5 12:50 216081969.1
>
>
>
>
>
>
>
>
>
>
>
>
> -----Original Message-----
> From: Kevin Grittner [mailto:Kevin.Grittner@wicourts.gov]
> Sent: Wednesday, May 05, 2010 3:59 PM
> To: pgsql-admin@postgresql.org; Khangelani Gama
> Subject: Re: [ADMIN] Table space grow big - PostgreSQL
>
> Khangelani Gama <Khangelani.Gama@ucs-software.co.za> wrote:
>
>> There is a script that runs once a month
>
> Most likely that should be daily, or at least weekly.
>
>> "REINDEX TABLE ${table}"
>> "VACUUM FULL VERBOSE ${table}"
>> "VACUUM ANALYZE ${table}"
>
> That's the wrong order.  Try:
>
> "VACUUM FULL VERBOSE ANALYZE ${table}"
> "REINDEX TABLE ${table}"
>
> With your current order, the VACUUM FULL bloats the indexes you've
> just rebuilt.
>
> If you vacuum frequently enough, you should not need to use the FULL
> option.
>
>> Dumping and restoring the database doesn't decrease the space
>
> Now, that's odd.  You're not restoring back into the same database
> without dropping it first (using the "clean" option), are you?
> Perhaps you have some very wide indexes, or a very large number of
> small tables?
>
>> There is nothing set in the postgresql.conf file that has to do
>> with vacuum analyze.
>
> Well, that wasn't the only thing I would look for; however, I'm not
> sure how many of the things I usually check exist in 7.3 or work the
> same way.  :-(
>
> -Kevin
>
> The contents of and attachments to this e-mail are intended for the addressee only, and may contain the confidential information of UCS Group and/or its subsidiaries.  Any review, use or dissemination thereof by anyone other than the intended addressee is prohibited.  If you are not the intended addressee please notify the writer immediately and destroy the e-mail.  UCS Group Limited and its subsidiaries distance themselves from and accept no liability for unauthorised use of their e-mail facilities or e-mails sent other than strictly for business purposes.
>
> --
> Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-admin
>



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

* Re: Table space grow big - PostgreSQL
@ 2010-05-06 09:28  Khangelani Gama <Khangelani.Gama@ucs-software.co.za>
  parent: Ian Lea <ian.lea@gmail.com>
  1 sibling, 1 reply; 14+ messages in thread

From: Khangelani Gama @ 2010-05-06 09:28 UTC (permalink / raw)
  To: pgsql-admin; +Cc: Ian Lea <ian.lea@gmail.com>; Nico Botha <Nico.Botha@ucs-software.co.za>

An Example from another server where the directory grew so big:


/data/postgres7.3.4/data/base/31057006/ directory shows the following size:

4.0K    ./pgsql_tmp
34G     .


A 34GB, it's those tablespaces with different sizes for each in 31057006/ directory.



We dumped the database using pg_dump, the dump file was 9.8G of size. We installed a brand new disc and then created a new database name then imported the data from the dump file of 9.8GB size.

Then I checked the size of /data/postgres7.3.4/data/base/16976/ new directory from the new disc. The size looks as follows:

4.0K    ./pgsql_tmp
6.0G    .



6.0G is way smaller then the 34G which was in the old disc.


The reboot does work, I am not sure the fsck command could fix the problem.

Note: there is nothing else that is inside the directory that's showing this big sizes.


We need a root cause that grow the size so big in the directory I mentioned.














-----Original Message-----
From: Ian Lea [mailto:ian.lea@gmail.com]
Sent: Thursday, May 06, 2010 10:49 AM
To: Khangelani Gama
Cc: pgsql-admin@postgresql.org
Subject: Re: [ADMIN] Table space grow big - PostgreSQL

I'm still confused about the disk space, even more so now that more
servers and figures of 1Gb and 15Gb have joined the party.

Presumably this:

> 3.6M    ./1
> 3.6M    ./16975
> 51G     ./95186722
> 4.8M    ./4830693
> 51G     .

is the output from some $ du command.  And is this

> -rw-------    1 postgres postgres      16K May  5 12:50 219436402
> -rw-------    1 postgres postgres      16K May  5 12:50 219436401
> -rw-------    1 postgres postgres      16K May  5 12:50 219436400
> -rw-------    1 postgres postgres      16K May  5 12:50 219436399
> -rw-------    1 postgres postgres      34M May  5 12:50 219436274
> -rw-------    1 postgres postgres      42M May  5 12:50 219436273
> -rw-------    1 postgres postgres      43M May  5 12:50 219436272
> -rw-------    1 postgres postgres      42M May  5 12:50 219436271
> -rw-------    1 postgres postgres      34M May  5 12:50 219436270
> -rw-------    1 postgres postgres      42M May  5 12:50 219436269
> -rw-------    1 postgres postgres      42M May  5 12:50 219436268
> -rw-------    1 postgres postgres      51M May  5 12:50 219436267
> -rw-------    1 postgres postgres      34M May  5 12:50 219436266
> -rw-------    1 postgres postgres      51M May  5 12:50 219436265
> -rw-------    1 postgres postgres      15M May  5 12:50 218478745
> -rw-------    1 postgres postgres      11M May  5 12:50 218478744
> -rw-------    1 postgres postgres      10M May  5 12:50 218478743
> -rw-------    1 postgres postgres      13M May  5 12:50 218478742
> -rw-------    1 postgres postgres     440M May  5 12:50 216081969.1

the output from some $ ls command on
/usr/local/pgsql/data/base/95186722?  You say there is nothing else in
that directory, but those sizes don't add up to 51Gb so something is
messed up somewhere.

Maybe this is nothing to do with postgres and a reboot and/or fsck of
the disk will fix everything.


--
Ian.


On Thu, May 6, 2010 at 7:33 AM, Khangelani Gama
<Khangelani.Gama@ucs-software.co.za> wrote:
> Thanks again for the replies:
>
>
> Responding to Kevin, Ian, and Inigo:
>
>
>
> 1. We'll try an change the order in the script
> 2. Daily vacuum analyze was disabled, which was running from a different script, we'll try to put it back.
> 3. The monthly script does work.
> 4. In my original email about the directory that takes more space:
>
> /usr/local/pgsql/data/base directory shows the following where 95186722/ takes a lot of space  :
>
> 3.6M    ./1
> 3.6M    ./16975
> 51G     ./95186722
> 4.8M    ./4830693
> 51G     .
>
>
>
> There is nothing else in /usr/local/pgsql/data/base/95186722/  directory except the table space names with different spaces for each one of them. And in other servers these table space sizes are now at 1.0G, for an example there is about 15 of them which makes about 15G.
>
> -rw-------    1 postgres postgres      16K May  5 12:50 219436402
> -rw-------    1 postgres postgres      16K May  5 12:50 219436401
> -rw-------    1 postgres postgres      16K May  5 12:50 219436400
> -rw-------    1 postgres postgres      16K May  5 12:50 219436399
> -rw-------    1 postgres postgres      34M May  5 12:50 219436274
> -rw-------    1 postgres postgres      42M May  5 12:50 219436273
> -rw-------    1 postgres postgres      43M May  5 12:50 219436272
> -rw-------    1 postgres postgres      42M May  5 12:50 219436271
> -rw-------    1 postgres postgres      34M May  5 12:50 219436270
> -rw-------    1 postgres postgres      42M May  5 12:50 219436269
> -rw-------    1 postgres postgres      42M May  5 12:50 219436268
> -rw-------    1 postgres postgres      51M May  5 12:50 219436267
> -rw-------    1 postgres postgres      34M May  5 12:50 219436266
> -rw-------    1 postgres postgres      51M May  5 12:50 219436265
> -rw-------    1 postgres postgres      15M May  5 12:50 218478745
> -rw-------    1 postgres postgres      11M May  5 12:50 218478744
> -rw-------    1 postgres postgres      10M May  5 12:50 218478743
> -rw-------    1 postgres postgres      13M May  5 12:50 218478742
> -rw-------    1 postgres postgres     440M May  5 12:50 216081969.1
>
>
>
>
>
>
>
>
>
>
>
>
> -----Original Message-----
> From: Kevin Grittner [mailto:Kevin.Grittner@wicourts.gov]
> Sent: Wednesday, May 05, 2010 3:59 PM
> To: pgsql-admin@postgresql.org; Khangelani Gama
> Subject: Re: [ADMIN] Table space grow big - PostgreSQL
>
> Khangelani Gama <Khangelani.Gama@ucs-software.co.za> wrote:
>
>> There is a script that runs once a month
>
> Most likely that should be daily, or at least weekly.
>
>> "REINDEX TABLE ${table}"
>> "VACUUM FULL VERBOSE ${table}"
>> "VACUUM ANALYZE ${table}"
>
> That's the wrong order.  Try:
>
> "VACUUM FULL VERBOSE ANALYZE ${table}"
> "REINDEX TABLE ${table}"
>
> With your current order, the VACUUM FULL bloats the indexes you've
> just rebuilt.
>
> If you vacuum frequently enough, you should not need to use the FULL
> option.
>
>> Dumping and restoring the database doesn't decrease the space
>
> Now, that's odd.  You're not restoring back into the same database
> without dropping it first (using the "clean" option), are you?
> Perhaps you have some very wide indexes, or a very large number of
> small tables?
>
>> There is nothing set in the postgresql.conf file that has to do
>> with vacuum analyze.
>
> Well, that wasn't the only thing I would look for; however, I'm not
> sure how many of the things I usually check exist in 7.3 or work the
> same way.  :-(
>
> -Kevin
>
> The contents of and attachments to this e-mail are intended for the addressee only, and may contain the confidential information of UCS Group and/or its subsidiaries.  Any review, use or dissemination thereof by anyone other than the intended addressee is prohibited.  If you are not the intended addressee please notify the writer immediately and destroy the e-mail.  UCS Group Limited and its subsidiaries distance themselves from and accept no liability for unauthorised use of their e-mail facilities or e-mails sent other than strictly for business purposes.
>
> --
> Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-admin
>

The contents of and attachments to this e-mail are intended for the addressee only, and may contain the confidential information of UCS Group and/or its subsidiaries.  Any review, use or dissemination thereof by anyone other than the intended addressee is prohibited.  If you are not the intended addressee please notify the writer immediately and destroy the e-mail.  UCS Group Limited and its subsidiaries distance themselves from and accept no liability for unauthorised use of their e-mail facilities or e-mails sent other than strictly for business purposes.



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

* Re: Table space grow big - PostgreSQL
@ 2010-05-06 09:32  Khangelani Gama <Khangelani.Gama@ucs-software.co.za>
  parent: Khangelani Gama <Khangelani.Gama@ucs-software.co.za>
  0 siblings, 0 replies; 14+ messages in thread

From: Khangelani Gama @ 2010-05-06 09:32 UTC (permalink / raw)
  To: pgsql-admin; +Cc: Ian Lea <ian.lea@gmail.com>; Nico Botha <Nico.Botha@ucs-software.co.za>

Sorry in my previous comments I meant the "reboot does not work or does not make a difference"



-----Original Message-----
From: pgsql-admin-owner@postgresql.org [mailto:pgsql-admin-owner@postgresql.org] On Behalf Of Khangelani Gama
Sent: Thursday, May 06, 2010 11:28 AM
To: pgsql-admin@postgresql.org
Cc: Ian Lea; Nico Botha
Subject: Re: [ADMIN] Table space grow big - PostgreSQL

An Example from another server where the directory grew so big:


/data/postgres7.3.4/data/base/31057006/ directory shows the following size:

4.0K    ./pgsql_tmp
34G     .


A 34GB, it's those tablespaces with different sizes for each in 31057006/ directory.



We dumped the database using pg_dump, the dump file was 9.8G of size. We installed a brand new disc and then created a new database name then imported the data from the dump file of 9.8GB size.

Then I checked the size of /data/postgres7.3.4/data/base/16976/ new directory from the new disc. The size looks as follows:

4.0K    ./pgsql_tmp
6.0G    .



6.0G is way smaller then the 34G which was in the old disc.


The reboot does work, I am not sure the fsck command could fix the problem.

Note: there is nothing else that is inside the directory that's showing this big sizes.


We need a root cause that grow the size so big in the directory I mentioned.














-----Original Message-----
From: Ian Lea [mailto:ian.lea@gmail.com]
Sent: Thursday, May 06, 2010 10:49 AM
To: Khangelani Gama
Cc: pgsql-admin@postgresql.org
Subject: Re: [ADMIN] Table space grow big - PostgreSQL

I'm still confused about the disk space, even more so now that more
servers and figures of 1Gb and 15Gb have joined the party.

Presumably this:

> 3.6M    ./1
> 3.6M    ./16975
> 51G     ./95186722
> 4.8M    ./4830693
> 51G     .

is the output from some $ du command.  And is this

> -rw-------    1 postgres postgres      16K May  5 12:50 219436402
> -rw-------    1 postgres postgres      16K May  5 12:50 219436401
> -rw-------    1 postgres postgres      16K May  5 12:50 219436400
> -rw-------    1 postgres postgres      16K May  5 12:50 219436399
> -rw-------    1 postgres postgres      34M May  5 12:50 219436274
> -rw-------    1 postgres postgres      42M May  5 12:50 219436273
> -rw-------    1 postgres postgres      43M May  5 12:50 219436272
> -rw-------    1 postgres postgres      42M May  5 12:50 219436271
> -rw-------    1 postgres postgres      34M May  5 12:50 219436270
> -rw-------    1 postgres postgres      42M May  5 12:50 219436269
> -rw-------    1 postgres postgres      42M May  5 12:50 219436268
> -rw-------    1 postgres postgres      51M May  5 12:50 219436267
> -rw-------    1 postgres postgres      34M May  5 12:50 219436266
> -rw-------    1 postgres postgres      51M May  5 12:50 219436265
> -rw-------    1 postgres postgres      15M May  5 12:50 218478745
> -rw-------    1 postgres postgres      11M May  5 12:50 218478744
> -rw-------    1 postgres postgres      10M May  5 12:50 218478743
> -rw-------    1 postgres postgres      13M May  5 12:50 218478742
> -rw-------    1 postgres postgres     440M May  5 12:50 216081969.1

the output from some $ ls command on
/usr/local/pgsql/data/base/95186722?  You say there is nothing else in
that directory, but those sizes don't add up to 51Gb so something is
messed up somewhere.

Maybe this is nothing to do with postgres and a reboot and/or fsck of
the disk will fix everything.


--
Ian.


On Thu, May 6, 2010 at 7:33 AM, Khangelani Gama
<Khangelani.Gama@ucs-software.co.za> wrote:
> Thanks again for the replies:
>
>
> Responding to Kevin, Ian, and Inigo:
>
>
>
> 1. We'll try an change the order in the script
> 2. Daily vacuum analyze was disabled, which was running from a different script, we'll try to put it back.
> 3. The monthly script does work.
> 4. In my original email about the directory that takes more space:
>
> /usr/local/pgsql/data/base directory shows the following where 95186722/ takes a lot of space  :
>
> 3.6M    ./1
> 3.6M    ./16975
> 51G     ./95186722
> 4.8M    ./4830693
> 51G     .
>
>
>
> There is nothing else in /usr/local/pgsql/data/base/95186722/  directory except the table space names with different spaces for each one of them. And in other servers these table space sizes are now at 1.0G, for an example there is about 15 of them which makes about 15G.
>
> -rw-------    1 postgres postgres      16K May  5 12:50 219436402
> -rw-------    1 postgres postgres      16K May  5 12:50 219436401
> -rw-------    1 postgres postgres      16K May  5 12:50 219436400
> -rw-------    1 postgres postgres      16K May  5 12:50 219436399
> -rw-------    1 postgres postgres      34M May  5 12:50 219436274
> -rw-------    1 postgres postgres      42M May  5 12:50 219436273
> -rw-------    1 postgres postgres      43M May  5 12:50 219436272
> -rw-------    1 postgres postgres      42M May  5 12:50 219436271
> -rw-------    1 postgres postgres      34M May  5 12:50 219436270
> -rw-------    1 postgres postgres      42M May  5 12:50 219436269
> -rw-------    1 postgres postgres      42M May  5 12:50 219436268
> -rw-------    1 postgres postgres      51M May  5 12:50 219436267
> -rw-------    1 postgres postgres      34M May  5 12:50 219436266
> -rw-------    1 postgres postgres      51M May  5 12:50 219436265
> -rw-------    1 postgres postgres      15M May  5 12:50 218478745
> -rw-------    1 postgres postgres      11M May  5 12:50 218478744
> -rw-------    1 postgres postgres      10M May  5 12:50 218478743
> -rw-------    1 postgres postgres      13M May  5 12:50 218478742
> -rw-------    1 postgres postgres     440M May  5 12:50 216081969.1
>
>
>
>
>
>
>
>
>
>
>
>
> -----Original Message-----
> From: Kevin Grittner [mailto:Kevin.Grittner@wicourts.gov]
> Sent: Wednesday, May 05, 2010 3:59 PM
> To: pgsql-admin@postgresql.org; Khangelani Gama
> Subject: Re: [ADMIN] Table space grow big - PostgreSQL
>
> Khangelani Gama <Khangelani.Gama@ucs-software.co.za> wrote:
>
>> There is a script that runs once a month
>
> Most likely that should be daily, or at least weekly.
>
>> "REINDEX TABLE ${table}"
>> "VACUUM FULL VERBOSE ${table}"
>> "VACUUM ANALYZE ${table}"
>
> That's the wrong order.  Try:
>
> "VACUUM FULL VERBOSE ANALYZE ${table}"
> "REINDEX TABLE ${table}"
>
> With your current order, the VACUUM FULL bloats the indexes you've
> just rebuilt.
>
> If you vacuum frequently enough, you should not need to use the FULL
> option.
>
>> Dumping and restoring the database doesn't decrease the space
>
> Now, that's odd.  You're not restoring back into the same database
> without dropping it first (using the "clean" option), are you?
> Perhaps you have some very wide indexes, or a very large number of
> small tables?
>
>> There is nothing set in the postgresql.conf file that has to do
>> with vacuum analyze.
>
> Well, that wasn't the only thing I would look for; however, I'm not
> sure how many of the things I usually check exist in 7.3 or work the
> same way.  :-(
>
> -Kevin
>
> The contents of and attachments to this e-mail are intended for the addressee only, and may contain the confidential information of UCS Group and/or its subsidiaries.  Any review, use or dissemination thereof by anyone other than the intended addressee is prohibited.  If you are not the intended addressee please notify the writer immediately and destroy the e-mail.  UCS Group Limited and its subsidiaries distance themselves from and accept no liability for unauthorised use of their e-mail facilities or e-mails sent other than strictly for business purposes.
>
> --
> Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-admin
>

The contents of and attachments to this e-mail are intended for the addressee only, and may contain the confidential information of UCS Group and/or its subsidiaries.  Any review, use or dissemination thereof by anyone other than the intended addressee is prohibited.  If you are not the intended addressee please notify the writer immediately and destroy the e-mail.  UCS Group Limited and its subsidiaries distance themselves from and accept no liability for unauthorised use of their e-mail facilities or e-mails sent other than strictly for business purposes.

--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

The contents of and attachments to this e-mail are intended for the addressee only, and may contain the confidential information of UCS Group and/or its subsidiaries.  Any review, use or dissemination thereof by anyone other than the intended addressee is prohibited.  If you are not the intended addressee please notify the writer immediately and destroy the e-mail.  UCS Group Limited and its subsidiaries distance themselves from and accept no liability for unauthorised use of their e-mail facilities or e-mails sent other than strictly for business purposes.



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

* Re: Table space grow big - PostgreSQL
@ 2010-05-06 09:59  Iñigo Martinez Lasala <imartinez@vectorsf.com>
  parent: Ian Lea <ian.lea@gmail.com>
  1 sibling, 0 replies; 14+ messages in thread

From: Iñigo Martinez Lasala @ 2010-05-06 09:59 UTC (permalink / raw)
  To: Khangelani.Gama@ucs-software.co.za; +Cc: pgsql-admin

I'm agree with ian.
There is something strange with your filesys...

Can you exec an 'ls -la' ? Perhaps somebody has move something else in
that folder with hidden name ( with a dot in folder name )
And, of course, a fsck should be advisable. :)  

-----Original Message-----
From: Ian Lea <ian.lea@gmail.com>
To: Khangelani Gama <Khangelani.Gama@ucs-software.co.za>
Cc: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>
Subject: Re: [ADMIN] Table space grow big - PostgreSQL
Date: Thu, 6 May 2010 09:49:19 +0100


I'm still confused about the disk space, even more so now that more
servers and figures of 1Gb and 15Gb have joined the party.

Presumably this:

> 3.6M    ./1
> 3.6M    ./16975
> 51G     ./95186722
> 4.8M    ./4830693
> 51G     .

is the output from some $ du command.  And is this

> -rw-------    1 postgres postgres      16K May  5 12:50 219436402
> -rw-------    1 postgres postgres      16K May  5 12:50 219436401
> -rw-------    1 postgres postgres      16K May  5 12:50 219436400
> -rw-------    1 postgres postgres      16K May  5 12:50 219436399
> -rw-------    1 postgres postgres      34M May  5 12:50 219436274
> -rw-------    1 postgres postgres      42M May  5 12:50 219436273
> -rw-------    1 postgres postgres      43M May  5 12:50 219436272
> -rw-------    1 postgres postgres      42M May  5 12:50 219436271
> -rw-------    1 postgres postgres      34M May  5 12:50 219436270
> -rw-------    1 postgres postgres      42M May  5 12:50 219436269
> -rw-------    1 postgres postgres      42M May  5 12:50 219436268
> -rw-------    1 postgres postgres      51M May  5 12:50 219436267
> -rw-------    1 postgres postgres      34M May  5 12:50 219436266
> -rw-------    1 postgres postgres      51M May  5 12:50 219436265
> -rw-------    1 postgres postgres      15M May  5 12:50 218478745
> -rw-------    1 postgres postgres      11M May  5 12:50 218478744
> -rw-------    1 postgres postgres      10M May  5 12:50 218478743
> -rw-------    1 postgres postgres      13M May  5 12:50 218478742
> -rw-------    1 postgres postgres     440M May  5 12:50 216081969.1

the output from some $ ls command on
/usr/local/pgsql/data/base/95186722?  You say there is nothing else in
that directory, but those sizes don't add up to 51Gb so something is
messed up somewhere.

Maybe this is nothing to do with postgres and a reboot and/or fsck of
the disk will fix everything.


--
Ian.


On Thu, May 6, 2010 at 7:33 AM, Khangelani Gama
<Khangelani.Gama@ucs-software.co.za> wrote:
> Thanks again for the replies:
>
>
> Responding to Kevin, Ian, and Inigo:
>
>
>
> 1. We'll try an change the order in the script
> 2. Daily vacuum analyze was disabled, which was running from a different script, we'll try to put it back.
> 3. The monthly script does work.
> 4. In my original email about the directory that takes more space:
>
> /usr/local/pgsql/data/base directory shows the following where 95186722/ takes a lot of space  :
>
> 3.6M    ./1
> 3.6M    ./16975
> 51G     ./95186722
> 4.8M    ./4830693
> 51G     .
>
>
>
> There is nothing else in /usr/local/pgsql/data/base/95186722/  directory except the table space names with different spaces for each one of them. And in other servers these table space sizes are now at 1.0G, for an example there is about 15 of them which makes about 15G.
>
> -rw-------    1 postgres postgres      16K May  5 12:50 219436402
> -rw-------    1 postgres postgres      16K May  5 12:50 219436401
> -rw-------    1 postgres postgres      16K May  5 12:50 219436400
> -rw-------    1 postgres postgres      16K May  5 12:50 219436399
> -rw-------    1 postgres postgres      34M May  5 12:50 219436274
> -rw-------    1 postgres postgres      42M May  5 12:50 219436273
> -rw-------    1 postgres postgres      43M May  5 12:50 219436272
> -rw-------    1 postgres postgres      42M May  5 12:50 219436271
> -rw-------    1 postgres postgres      34M May  5 12:50 219436270
> -rw-------    1 postgres postgres      42M May  5 12:50 219436269
> -rw-------    1 postgres postgres      42M May  5 12:50 219436268
> -rw-------    1 postgres postgres      51M May  5 12:50 219436267
> -rw-------    1 postgres postgres      34M May  5 12:50 219436266
> -rw-------    1 postgres postgres      51M May  5 12:50 219436265
> -rw-------    1 postgres postgres      15M May  5 12:50 218478745
> -rw-------    1 postgres postgres      11M May  5 12:50 218478744
> -rw-------    1 postgres postgres      10M May  5 12:50 218478743
> -rw-------    1 postgres postgres      13M May  5 12:50 218478742
> -rw-------    1 postgres postgres     440M May  5 12:50 216081969.1
>
>
>
>
>
>
>
>
>
>
>
>
> -----Original Message-----
> From: Kevin Grittner [mailto:Kevin.Grittner@wicourts.gov]
> Sent: Wednesday, May 05, 2010 3:59 PM
> To: pgsql-admin@postgresql.org; Khangelani Gama
> Subject: Re: [ADMIN] Table space grow big - PostgreSQL
>
> Khangelani Gama <Khangelani.Gama@ucs-software.co.za> wrote:
>
>> There is a script that runs once a month
>
> Most likely that should be daily, or at least weekly.
>
>> "REINDEX TABLE ${table}"
>> "VACUUM FULL VERBOSE ${table}"
>> "VACUUM ANALYZE ${table}"
>
> That's the wrong order.  Try:
>
> "VACUUM FULL VERBOSE ANALYZE ${table}"
> "REINDEX TABLE ${table}"
>
> With your current order, the VACUUM FULL bloats the indexes you've
> just rebuilt.
>
> If you vacuum frequently enough, you should not need to use the FULL
> option.
>
>> Dumping and restoring the database doesn't decrease the space
>
> Now, that's odd.  You're not restoring back into the same database
> without dropping it first (using the "clean" option), are you?
> Perhaps you have some very wide indexes, or a very large number of
> small tables?
>
>> There is nothing set in the postgresql.conf file that has to do
>> with vacuum analyze.
>
> Well, that wasn't the only thing I would look for; however, I'm not
> sure how many of the things I usually check exist in 7.3 or work the
> same way.  :-(
>
> -Kevin
>
> The contents of and attachments to this e-mail are intended for the addressee only, and may contain the confidential information of UCS Group and/or its subsidiaries.  Any review, use or dissemination thereof by anyone other than the intended addressee is prohibited.  If you are not the intended addressee please notify the writer immediately and destroy the e-mail.  UCS Group Limited and its subsidiaries distance themselves from and accept no liability for unauthorised use of their e-mail facilities or e-mails sent other than strictly for business purposes.
>
> --
> Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-admin
>

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


end of thread, other threads:[~2010-05-06 09:59 UTC | newest]

Thread overview: 14+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2010-05-05 11:36 Table space grow big - PostgreSQL Khangelani Gama <Khangelani.Gama@ucs-software.co.za>
2010-05-05 11:42 ` Brett Parker <iDunno@sommitrealweird.co.uk>
2010-05-05 13:42   ` Khangelani Gama <Khangelani.Gama@ucs-software.co.za>
2010-05-05 13:54     ` Iñigo Martinez Lasala <imartinez@vectorsf.com>
2010-05-05 13:54     ` Ian Lea <ian.lea@gmail.com>
2010-05-05 13:59     ` Kevin Grittner <Kevin.Grittner@wicourts.gov>
2010-05-06 06:33       ` Khangelani Gama <Khangelani.Gama@ucs-software.co.za>
2010-05-06 08:49         ` Ian Lea <ian.lea@gmail.com>
2010-05-06 09:28           ` Khangelani Gama <Khangelani.Gama@ucs-software.co.za>
2010-05-06 09:32             ` Khangelani Gama <Khangelani.Gama@ucs-software.co.za>
2010-05-06 09:59           ` Iñigo Martinez Lasala <imartinez@vectorsf.com>
2010-05-05 11:47 ` Devrim GÜNDÜZ <devrim@gunduz.org>
2010-05-05 11:45 Re: Table space grow big - PostgreSQL Kevin Grittner <Kevin.Grittner@wicourts.gov>
2010-05-05 12:01 ` Achilleas Mantzios <achill@matrix.gatewaynet.com>

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