Re: Background vacuum - Mailing list pgsql-performance

From Dan Harris
Subject Re: Background vacuum
Date
Msg-id 4642A811.9010703@drivefaster.net
Whole thread Raw
In response to Background vacuum  (Daniel Haensse <daniel.haensse@swissembedded.com>)
Responses Re: Background vacuum  (Ron Mayer <rm_pg@cheapcomplexdevices.com>)
List pgsql-performance
Daniel Haensse wrote:
> Dear list,
>
> I'm running postgres on a tomcat server. The vacuum is run every hour
> (cronjob) which leads to a performance drop of the tomcat applications.
> I played around with renice command and I think it is possible to reduce
> this effect which a renice. The problem is how can I figure out the PID
> of the postmaster performing the vacuum(automated)? Has anybody a nice
> solution to change process priority? A shell script, maybe even for java?
>

While this may technically work, I think it lacks a key point.  'nice' ( at
least the versions I'm familiar with ) do not adjust I/O priority.  VACUUM is
bogging things down because of the extra strain on I/O.  CPU usage shouldn't
really be much of a factor.

Instead, I would recommend looking at vacuum_cost_delay and the related settings
to make vacuum lower priority than the queries you care about.  This should be a
cleaner solution for you.

-Dan

pgsql-performance by date:

Previous
From: Daniel Haensse
Date:
Subject: Background vacuum
Next
From: "Valentine Gogichashvili"
Date:
Subject: Re: Cannot make GIN intarray index be used by the planner