pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Decibel! <decibel@decibel.org>
To: Alan Hodgson <ahodgson@simkin.ca>
Cc: pgsql-performance@postgresql.org
Subject: Re: cpu throttling
Date: Fri, 3 Aug 2007 17:17:42 -0500
Message-ID: <20070803221742.GV25704@nasby.net> (raw)
In-Reply-To: <200708020914.37180@hal.medialogik.com>
References: <bd8531800708020902v5e6a0928ted3721f3eb543dc8@mail.gmail.com>
	<200708020914.37180@hal.medialogik.com>

On Thu, Aug 02, 2007 at 09:14:37AM -0700, Alan Hodgson wrote:
> On Thursday 02 August 2007 09:02, "Bryan Murphy" <bryan.murphy@gmail.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@decibel.org
EnterpriseDB      http://enterprisedb.com      512.569.9461 (cell)

view thread (4+ messages)

Message-ID: <20070803221742.GV25704@nasby.net>
Permalink:  ../20070803221742.GV25704@nasby.net/
Also on:    postgresql.org/message-id/20070803221742.GV25704@nasby.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: decibel@decibel.org, ahodgson@simkin.ca
  Subject: Re: cpu throttling
  In-Reply-To: <20070803221742.GV25704@nasby.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox