Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 5D01A9FBE55 for ; Thu, 2 Aug 2007 13:08:39 -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 18405-04 for ; Thu, 2 Aug 2007 13:08:36 -0300 (ADT) X-Greylist: delayed 00:06:24.340662 by SQLgrey-1.7.5 Received: from el-out-1112.google.com (el-out-1112.google.com [209.85.162.177]) by postgresql.org (Postfix) with ESMTP id 553E29FBE54 for ; Thu, 2 Aug 2007 13:08:35 -0300 (ADT) Received: by el-out-1112.google.com with SMTP id r23so82038elf for ; Thu, 02 Aug 2007 09:08:33 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=lAotn/sLSMMrg34QwwkO888UoE5XtpbGBFb6Z3zrkadSg1C74BgQI09Ll3KVp50zckttoG/pOfg6pJRCbgOTNkSBNLHRZRTQrhq6abCl8p9Ieq3w1ScVtlf6ahp/EUwqZeSOY3Lmj3ZRYqM3dzxSP7JUGerkN5RGlG/Rf02JIMY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=Dcwc5Ux/yzIgksPvLh3TnsrpCFSK64dKao/cBjQ5EN+hsCbdpcE67xj7ge838HfvRDKUPmQ+JxoXidN1rSbvad+WzmbYmDtfDcznOEf7diua1mdPgl9x0I0OimyQmRUQUnvJ/aKLtEMMde4W2CSN3VhM4XpiALOEesJOsp0wuqU= Received: by 10.100.177.16 with SMTP id z16mr1210184ane.1186070527737; Thu, 02 Aug 2007 09:02:07 -0700 (PDT) Received: by 10.100.41.17 with HTTP; Thu, 2 Aug 2007 09:02:07 -0700 (PDT) Message-ID: Date: Thu, 2 Aug 2007 11:02:07 -0500 From: "Bryan Murphy" To: pgsql-performance@postgresql.org Subject: cpu throttling MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200708/10 X-Sequence-Number: 26140 We have a complicated stored procedure that we run frequently. It pegs one of our postmaster processes at 100% CPU utilization for a few hours. This has the unfortunate side effect of causing increased latency for our other queries. We are currently planning a fix, but because of the complicated nature of this procedure it is going to take some time to implement. I've noticed that if I renice the process that is running the query, the other postmaster processes are able to respond to our other queries in a timely fashion. 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. Bryan