Обсуждение: Autovacuum working / not working ?

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

Autovacuum working / not working ?

От
"Machiel Richards"
Дата:

Hi All

 

   I hope that someone can perhaps assist me with some insight into the autovacuum as well.

 

    I have a couple of Postgresql databases at a client site.

 

   The autovacuum is enabled, however when I run the sql query below it does not return any results:

 

Query:

select relname, last_vacuum, last_analyze,last_autovacuum,last_autoanalyze

from pg_stat_all_tables

where schemaname = 'public';

 

results:

 

postgres-# where schemaname = 'public';

 relname | last_vacuum | last_analyze | last_autovacuum | last_autoanalyze

---------+-------------+--------------+-----------------+------------------

(0 rows)

 

 

 

                They are running  a combination of postgresql 8.1 and 8.3 over a couple of servers.

 

  The current settings for the autovacuum are as follows:

 

  

autovacuum                      | on                                       | Starts the autovacuum subprocess.

 autovacuum_analyze_scale_factor | 0.1                                      | Number of tuple inserts, updates or deletes prior to analyze as a fraction of reltuples.

 autovacuum_analyze_threshold    | 50                                       | Minimum number of tuple inserts, updates or deletes prior to analyze.

 autovacuum_freeze_max_age       | 200000000                                | Age at which to autovacuum a table to prevent transaction ID wraparound.

 autovacuum_max_workers          | 3                                        | Sets the maximum number of simultaneously running autovacuum worker processes.

 autovacuum_naptime              | 1min                                     | Time to sleep between autovacuum runs.

 autovacuum_vacuum_cost_delay    | 20ms                                     | Vacuum cost delay in milliseconds, for autovacuum.

 autovacuum_vacuum_cost_limit    | -1                                       | Vacuum cost amount available before napping, for autovacuum.

 autovacuum_vacuum_scale_factor  | 0.2                                      | Number of tuple updates or deletes prior to vacuum as a fraction of reltuples.

 autovacuum_vacuum_threshold     | 50                      

 

 

Your assistance will be appreciated.

 

 

Machiel Richards

MySQL DBA

Relational Database Consulting

 

RDC_Logo

 

Вложения

Re: Autovacuum working / not working ?

От
Shoaib Mir
Дата:
On Wed, May 5, 2010 at 3:28 PM, Machiel Richards <machielr@rdc.co.za> wrote:

Hi All

 postgres-# where schemaname = 'public';

 relname | last_vacuum | last_analyze | last_autovacuum | last_autoanalyze

---------+-------------+--------------+-----------------+------------------

(0 rows)


Hmmm... looks like you don't have any tables in the public schema, is that true?

Or it might be you are connected to 'postgres' (default) DB and not the correct one.  

--
Shoaib Mir
http://shoaibmir.wordpress.com/

Re: Autovacuum working / not working ?

От
"Machiel Richards"
Дата:

I am connected to the default db (postgres).

 

Does this need to be run on a per database basis?

 

Reason for asking is because the client have a total of about 120 databases running at present , does this then need to be run on each database?

 

They for instance have one server with postgresql installed and running but may have up to 24 databases created (one for each client).

 

 

Ps... a consolidation process still underway to consolidate to one server and db with schemas for each client, however this will still take quite some time to implement and in the meantime we need to monitor these databases.

 

From: Shoaib Mir [mailto:shoaibmir@gmail.com]
Sent: 05 May 2010 7:38 AM
To: Machiel Richards
Cc: pgsql-novice@postgresql.org
Subject: Re: [NOVICE] Autovacuum working / not working ?

 

On Wed, May 5, 2010 at 3:28 PM, Machiel Richards <machielr@rdc.co.za> wrote:

Hi All

 postgres-# where schemaname = 'public';

 relname | last_vacuum | last_analyze | last_autovacuum | last_autoanalyze

---------+-------------+--------------+-----------------+------------------

(0 rows)

 

Hmmm... looks like you don't have any tables in the public schema, is that true?

 

Or it might be you are connected to 'postgres' (default) DB and not the correct one.  


--
Shoaib Mir
http://shoaibmir.wordpress.com/

Re: Autovacuum working / not working ?

От
Shoaib Mir
Дата:
On Wed, May 5, 2010 at 3:45 PM, Machiel Richards <machielr@rdc.co.za> wrote:

I am connected to the default db (postgres).

 

Does this need to be run on a per database basis?

 


AFAIK, it has to be database specific. 

But again that shouldn't be hard as you can get a list from pg_database and loop through that using this query and pass the results to something like Nagios (or any other monitoring tool you are using) for alerts. 

--
Shoaib Mir
http://shoaibmir.wordpress.com/