Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Performance > Re: Vacuum sett...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 14 of 14 Topic 3991 of 4355
Post > Topic >>

Re: Vacuum settings

by gc@[EMAIL PROTECTED] (Guillaume Cottenceau) Apr 21, 2008 at 05:31 PM

dforums <dforums 'at' vieonet.com> writes:

> 2Q) Here are my settings for vacuum, could you help me to optimise
> those settings, at the moment the vacuum analyse sent every night is
> taking around 18 h to run, which slow down the server performance.

It's a lot of time for a daily job (and it is interesting to
vacuum hot tables more often than daily). With typical settings,
it's probable that autovacuum will run forever (e.g. at the end
of run, another run will already be needed). You should first
verify you don't have bloat in your tables (a lot of dead rows) -
bloat can be created by too infrequent vacuuming and too low FSM
settings[1]. To fix the bloat, you can dump and restore your DB
if you can afford interrupting your application, or use VACUUM
FULL if you can afford blocking your application (disclaimer:
many posters here passionately disgust VACUUM FULL and keep on
suggesting the use of CLUSTER).

Ref: 
[1] to say whether you have bloat, you can use
    contrib/pgstattuple (you can easily add it to a running
    PostgreSQL). If the free_percent re****ted for interesting
    tables is large, and free_space is large compared to 8K, then
    you have bloat;

    another way is to dump your database, restore it onto another
    database, issue VACUUM VERBOSE on a given table on both
    databases (in live, and on the restore) and compare the
    re****ted number of pages needed. The difference is the
    bloat.

      live=# VACUUM VERBOSE interesting_table;
          [...]
      INFO:  "interesting_table": found 408 removable, 64994 nonremovable
row versions in 4395 pages

      restored=# VACUUM VERBOSE interesting_table;
          [...]
      INFO:  "interesting_table": found 0 removable, 64977 nonremovable
row versions in 628 pages

    => (4395-628)*8/1024.0 MB of bloat

    (IIRC, this VACUUM output is for 7.4, it has changed a bit
    since then)

-- 
Guillaume Cottenceau

-- 
Sent via pgsql-performance mailing list (pgsql-performance@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance
 




 14 Posts in Topic:
shared_buffers performance
mendola@[EMAIL PROTECTED]  2008-04-14 11:13:05 
Re: shared_buffers performance
stark@[EMAIL PROTECTED]   2008-04-14 11:56:47 
Re: shared_buffers performance
dev@[EMAIL PROTECTED] (R  2008-04-14 12:25:45 
Re: shared_buffers performance
gsmith@[EMAIL PROTECTED]   2008-04-14 11:44:44 
Re: shared_buffers performance
tgl@[EMAIL PROTECTED] (T  2008-04-14 15:31:54 
Re: shared_buffers performance
stark@[EMAIL PROTECTED]   2008-04-14 20:58:21 
Re: shared_buffers performance
gsmith@[EMAIL PROTECTED]   2008-04-14 16:08:48 
Re: shared_buffers performance
gsmith@[EMAIL PROTECTED]   2008-04-14 11:42:50 
Re: shared_buffers performance
Gaetano Mendola <mendo  2008-04-15 11:05:12 
Re: shared_buffers performance
Gaetano Mendola <mendo  2008-04-15 11:11:31 
Vacuum settings
dforums@[EMAIL PROTECTED]  2008-04-20 19:48:53 
Re: Vacuum settings
alvherre@[EMAIL PROTECTED  2008-04-21 11:03:37 
Re: shared_buffers performance
mendola@[EMAIL PROTECTED]  2008-04-15 17:08:02 
Re: Vacuum settings
gc@[EMAIL PROTECTED] (Gu  2008-04-21 17:31:03 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Oct 13 4:00:27 CDT 2008.