Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 026869F93A3 for ; Thu, 2 Aug 2007 13:14:46 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 19469-07-2 for ; Thu, 2 Aug 2007 13:14:39 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from skynet.simkin.ca (skynet.simkin.ca [72.51.27.117]) by postgresql.org (Postfix) with ESMTP id 0632D9F9C5A for ; Thu, 2 Aug 2007 13:14:38 -0300 (ADT) Received: from charon.medialogik.com (charon.medialogik.com [72.51.27.114]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by skynet.simkin.ca (Postfix) with ESMTP id 56E0B4A81 for ; Thu, 2 Aug 2007 09:14:38 -0700 (PDT) From: Alan Hodgson Organization: Simkin Network Consulting To: pgsql-performance@postgresql.org Subject: Re: cpu throttling Date: Thu, 2 Aug 2007 09:14:37 -0700 User-Agent: KMail/1.9.5 References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200708020914.37180@hal.medialogik.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200708/11 X-Sequence-Number: 26141 On Thursday 02 August 2007 09:02, "Bryan Murphy" 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 .. -- "Remember when computers were frustrating because they did exactly what you told them to? That actually seems sort of quaint now." --J.D. Baldwin