Re: low priority postmaster threads?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Chris Storah <cstorah(at)emis-support(dot)demon(dot)co(dot)uk>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: low priority postmaster threads?
Date: 2001-02-21 23:10:03
Message-ID: 12895.982797003@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I wrote:
> Chris Storah <cstorah(at)emis-support(dot)demon(dot)co(dot)uk> writes:
>> What I am looking for is a postgres system that runs 100 users or so at
>> 'full speed', and major day long queries at a 'when idle' priority.

> The trouble here is that CPU nice doesn't (on most platforms) change the
> behavior of the I/O scheduler, so this would only be of use to the
> extent that your queries are CPU bound and not I/O bound.

Now that I think twice, there's an even more severe problem with trying
to nice() down an individual backend, namely priority inversion.

What happens when the low-priority process holds some lock or other,
and then a higher-priority process comes along and wants the lock?
The high-priority process has to wait, that's what. But there's no
mechanism to raise the priority of the lower-priority lock holder, which
means that the high-priority process is now effectively lowered to the
lower priority; it may have to wait quite a long time, if there are
other high-priority processes sucking CPU away from the low-priority
guy.

In short, forget about nice'ing an individual backend; you probably
won't like the results. Sorry.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2001-02-21 23:34:24 Re: Bug: COUNT() and ExecEvalAggref error
Previous Message Dan Lyke 2001-02-21 23:02:08 Bug: COUNT() and ExecEvalAggref error