Re: "set nice" running a transaction in a lower priority?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Richard Huxton <dev(at)archonet(dot)com>
Cc: "Clark C (dot) Evans" <cce(at)clarkevans(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: "set nice" running a transaction in a lower priority?
Date: 2002-06-13 13:09:46
Message-ID: 18702.1023973786@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Richard Huxton <dev(at)archonet(dot)com> writes:
> On Wednesday 12 Jun 2002 6:33 pm, Clark C . Evans wrote:
>> I was wondering if there is a way to set transaction
>> priority so that it takes its good sweet time and
>> handles other queries quickly?

> Not really - and it might be counter-productive to slow down the import. If
> another transaction can't complete until the import is finished then
> everything could end up delayed.

> I guess you could nice the pid of the relevant backend process,

That would be a bad idea for the same reason --- you'd get into
priority-inversion scenarios where foreground processes are waiting for
the low-priority process, which can't run because other foreground
processes are hogging all the CPU.

> but I'd be
> inclined to batch the import into sections of 5000 records or so and sleep
> for a second between batches.

Some kind of throttle on the client side seems like a better idea to me
too.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Clark C . Evans 2002-06-13 13:36:40 Re: "set nice" running a transaction in a lower priority?
Previous Message Tom Lane 2002-06-13 13:06:18 Re: Help required with installing postgreSQL on SCO Openserver