Re: Background vacuum

From: Andrew Sullivan <ajs(at)crankycanuck(dot)ca>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: Background vacuum
Date: 2007-05-17 13:55:30
Message-ID: 20070517135530.GI6907@phlogiston.dyndns.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Thu, May 10, 2007 at 05:10:56PM -0700, Ron Mayer wrote:
> One way is to write astored procedure that sets it's own priority.
> An example is here:
> http://weblog.bignerdranch.com/?p=11

Do you have evidence to show this will actually work consistently?
The problem with doing this is that if your process is holding a lock
that prevents some other process from doing something, then your
lowered priority actually causes that _other_ process to go slower
too. This is part of the reason people object to the suggestion that
renicing a single back end will help anything.

> This paper studied both CPU and lock priorities on a variety
> of databases including PostgreSQL.
>
> http://www.cs.cmu.edu/~bianca/icde04.pdf
>
> " By contrast, for PostgreSQL, lock scheduling is not as
> effective as CPU scheduling (see Figure 4(c)).

It is likely that in _some_ cases, you can get this benefit, because
you don't have contention issues. The explanation for the good lock
performance by Postgres on the TPC-C tests they were using is
PostgreSQL's MVCC: Postgres locks less. The problem comes when you
have contention, and in that case, CPU scheduling will really hurt.

This means that, to use CPU scheduling safely, you have to be really
sure that you know what the other transactions are doing.

A

--
Andrew Sullivan | ajs(at)crankycanuck(dot)ca
Information security isn't a technological problem. It's an economics
problem.
--Bruce Schneier

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Keaton Adams 2007-05-17 14:04:30 WAL log performance/efficiency question
Previous Message Sergei Shelukhin 2007-05-17 05:42:27 any way to get rid of Bitmap Heap Scan recheck?