Skip site navigation (1) Skip section navigation (2)

Re: Capping CPU usage?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Rod Taylor <rbt(at)rbt(dot)ca>
Cc: Josh Berkus <josh(at)agliodbs(dot)com>,Pgsql Performance <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Capping CPU usage?
Date: 2002-12-12 05:52:10
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-performance
Rod Taylor <rbt(at)rbt(dot)ca> writes:
>> I had a new question from a client: is it possible to "cap" CPU usage
>> for PostgreSQL running on Linux?

> Anyway, would it be sufficient to simply reduce the priority of the
> process?

If the issue is to prevent Postgres *as a whole* from hogging CPU usage,
I would think that nice-ing the postmaster at launch would work
beautifully.  Requests like "I want Postgres to use no more than 30%
of CPU" make no sense to me: if the CPU is otherwise idle, why should
you insist on reserving 70% of it for the idle loop?

But what we commonly see is "I want to cap the resource usage of this
particular query", and that is a whole lot harder.  You cannot win by
nice-ing one single backend, because of priority-inversion concerns.
(The queries you would like to be high-priority might be blocked waiting
for locks held by low-priority backends.)

			regards, tom lane

In response to


pgsql-performance by date

Next:From: Shridhar DaithankarDate: 2002-12-12 07:13:02
Subject: Re: Good/Bad RAID and SCSI controllers?
Previous:From: Tom LaneDate: 2002-12-12 05:41:33
Subject: Re: Docs: GIST

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group