pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Autovacuum Issue
5+ messages / 5 participants
[nested] [flat]

* Autovacuum Issue
@ 2011-11-23 05:55  J Ramesh Kumar <rameshj1977@gmail.com>
  0 siblings, 3 replies; 5+ messages in thread

From: J Ramesh Kumar @ 2011-11-23 05:55 UTC (permalink / raw)
  To: pgsql-performance

Hi,

My application is performing 1600 inserts per second and 7 updates per
second. The updates occurred only in a small table which has only 6 integer
columns. The inserts occurred in all other daily tables. My application
creates around 75 tables per day. No updates/deletes occurred in those 75
daily tables (only inserts and drop tables if older than 40 days). Since
only inserts in the daily tables, I disabled autovacuum in the conf file
and I can see it is off stat using show command.

*sasdb=# show "autovacuum";
 autovacuum
------------
 off
(1 row)*

But the autovacuum is running frequently and it impact the performance of
my system(high CPU). You can see the autovacuum in the pg_stat_activity.
*
sasdb=# select current_query from pg_stat_activity where current_query like
'autovacuum%';
                              **       current_query
**

------------------------------**------------------------------**
---------------------------
 autovacuum: VACUUM public.xxxxx**_17_Oct_11 (to prevent wraparound)
 autovacuum: VACUUM public.**xxxxx**_17_Oct_11 (to prevent wraparound)
 autovacuum: VACUUM public.**xxxxx**_17_Oct_11 (to prevent wraparound)
(3 rows)


*Why the autovacuum is running even though, I disabled ? Am I miss anything
?

And also please share your views on my decision about disable autovacuum
for my application. I am planning to run vacuum command daily on that small
table which has frequent updates.

Thanks,
Ramesh

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

* Re: Autovacuum Issue
@ 2011-11-23 06:10  Raghavendra <raghavendra.rao@enterprisedb.com>
  parent: J Ramesh Kumar <rameshj1977@gmail.com>
  2 siblings, 0 replies; 5+ messages in thread

From: Raghavendra @ 2011-11-23 06:10 UTC (permalink / raw)
  To: J Ramesh Kumar <rameshj1977@gmail.com>; +Cc: pgsql-performance

On Wed, Nov 23, 2011 at 11:25 AM, J Ramesh Kumar <rameshj1977@gmail.com>wrote:

> Hi,
>
> My application is performing 1600 inserts per second and 7 updates per
> second. The updates occurred only in a small table which has only 6 integer
> columns. The inserts occurred in all other daily tables. My application
> creates around 75 tables per day. No updates/deletes occurred in those 75
> daily tables (only inserts and drop tables if older than 40 days). Since
> only inserts in the daily tables, I disabled autovacuum in the conf file
> and I can see it is off stat using show command.
>
> *sasdb=# show "autovacuum";
>  autovacuum
> ------------
>  off
> (1 row)*
>
> But the autovacuum is running frequently and it impact the performance of
> my system(high CPU). You can see the autovacuum in the pg_stat_activity.
> *
> sasdb=# select current_query from pg_stat_activity where current_query
> like 'autovacuum%';
>                               **       current_query                 **
>
> ------------------------------**------------------------------**
> ---------------------------
>  autovacuum: VACUUM public.xxxxx**_17_Oct_11 (to prevent wraparound)
>  autovacuum: VACUUM public.**xxxxx**_17_Oct_11 (to prevent wraparound)
>  autovacuum: VACUUM public.**xxxxx**_17_Oct_11 (to prevent wraparound)
> (3 rows)
>
>
> *


Its pretty clear, its to prevent tranx wrap-around.

autovacuum_freeze_max_age (integer)

Specifies the maximum age (in transactions) that a table's pg_class.
relfrozenxid field can attain before a VACUUM operation is forced to
prevent transaction ID wraparound within the table. Note that the system
will launch autovacuum processes to prevent wraparound even when autovacuum
is otherwise disabled.

http://developer.postgresql.org/pgdocs/postgres/runtime-config-autovacuum.html
---
Regards,
Raghavendra
EnterpriseDB Corporation
Blog: http://raghavt.blogspot.com/





> **Why the autovacuum is running even though, I disabled ? Am I miss
> anything ?
>
> And also please share your views on my decision about disable autovacuum
> for my application. I am planning to run vacuum command daily on that small
> table which has frequent updates.
>
> Thanks,
> Ramesh
>

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

* Re: Autovacuum Issue
@ 2011-12-01 18:18  Robert Haas <robertmhaas@gmail.com>
  parent: J Ramesh Kumar <rameshj1977@gmail.com>
  2 siblings, 1 reply; 5+ messages in thread

From: Robert Haas @ 2011-12-01 18:18 UTC (permalink / raw)
  To: J Ramesh Kumar <rameshj1977@gmail.com>; +Cc: pgsql-performance

On Wed, Nov 23, 2011 at 12:55 AM, J Ramesh Kumar <rameshj1977@gmail.com> wrote:
> Why the autovacuum is running even though, I disabled ? Am I miss anything ?

As Raghavendra says, anti-wraparound vacuum will always kick in to
prevent a database shutdown.

> And also please share your views on my decision about disable autovacuum for
> my application. I am planning to run vacuum command daily on that small
> table which has frequent updates.

Sounds like a bad plan.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



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

* Re: Autovacuum Issue
@ 2011-12-01 22:35  Mark Kirkwood <mark.kirkwood@catalyst.net.nz>
  parent: Robert Haas <robertmhaas@gmail.com>
  0 siblings, 0 replies; 5+ messages in thread

From: Mark Kirkwood @ 2011-12-01 22:35 UTC (permalink / raw)
  To: pgsql-performance

On 02/12/11 07:18, Robert Haas wrote:
>
> And also please share your views on my decision about disable autovacuum for
> my application. I am planning to run vacuum command daily on that small
> table which has frequent updates.
> Sounds like a bad plan.
>

If the table has frequent updates vacuuming once a day will not control 
space bloat from dead rows... so your small table's storage will become 
a very large (even though there are only a few undeleted rows), and 
performance will become terrible.

I would suggest tuning autovacuum to wakeup more frequently (c.f 
autovacuum_naptime parameter), so your small table stays small.

Also you didn't mention what version of Postgres you are running. In 8.4 
and later vacuum (hence autovacuum) is much smarter about finding dead 
rows to clean up, and should have less impact. You can also control the 
load autovacuum puts on your system (c.f autovacuum_vacuum_cost_delay 
parameter).

regards

Mark



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

* Re: Autovacuum Issue
@ 2011-12-02 03:02  Scott Marlowe <scott.marlowe@gmail.com>
  parent: J Ramesh Kumar <rameshj1977@gmail.com>
  2 siblings, 0 replies; 5+ messages in thread

From: Scott Marlowe @ 2011-12-02 03:02 UTC (permalink / raw)
  To: J Ramesh Kumar <rameshj1977@gmail.com>; +Cc: pgsql-performance

On Tue, Nov 22, 2011 at 10:55 PM, J Ramesh Kumar <rameshj1977@gmail.com> wrote:
> But the autovacuum is running frequently and it impact the performance of my
> system(high CPU). You can see the autovacuum in the pg_stat_activity.

Could you show us the system metrics that led you to believe it was
high CPU usage?  Sometimes people misinterpret the numbers from
utilities like top, iostat, or vmstat, so I'd rather see them myself
if you got them.



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


end of thread, other threads:[~2011-12-02 03:02 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-11-23 05:55 Autovacuum Issue J Ramesh Kumar <rameshj1977@gmail.com>
2011-11-23 06:10 ` Raghavendra <raghavendra.rao@enterprisedb.com>
2011-12-01 18:18 ` Robert Haas <robertmhaas@gmail.com>
2011-12-01 22:35   ` Mark Kirkwood <mark.kirkwood@catalyst.net.nz>
2011-12-02 03:02 ` Scott Marlowe <scott.marlowe@gmail.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