Re: cpu throttling

From: Decibel! <decibel(at)decibel(dot)org>
To: Alan Hodgson <ahodgson(at)simkin(dot)ca>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: cpu throttling
Date: 2007-08-03 22:17:42
Message-ID: 20070803221742.GV25704@nasby.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Thu, Aug 02, 2007 at 09:14:37AM -0700, Alan Hodgson wrote:
> On Thursday 02 August 2007 09:02, "Bryan Murphy" <bryan(dot)murphy(at)gmail(dot)com>
> wrote:
> > My question: Is there a way I can decrease the priority of a specific
> > query, or determine the PID of the process it is running in? I'd like
> > to throw together a quick shell script if at all possible, as right
> > now I have to monitor the process manually and we'll have fixed the
> > problem long before we have the chance to implement proper database
> > clustering.
>
> select procpid from pg_stat_activity where current_query
> like '%stored_proc%' and current_query not like '%pg_stat_activity%';
>
> requires stats_command_string to be enabled
>
> I'm surprised your operating system doesn't automatically lower the priority
> of the process, though ..

The OS will only lower it to a certain extent.

Also, make sure you understand the concept of priority inversion before
going into production with this solution.
--
Decibel!, aka Jim Nasby decibel(at)decibel(dot)org
EnterpriseDB http://enterprisedb.com 512.569.9461 (cell)

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2007-08-03 22:34:09 Re: Performance problems with large telemetric datasets on 7.4.2
Previous Message Andrew Kroeger 2007-08-03 21:13:27 Re: Performance problems with large telemetric datasets on 7.4.2