Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id BAA489FB5BC for ; Fri, 3 Aug 2007 19:18:20 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 58420-03 for ; Fri, 3 Aug 2007 19:18:17 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from noel.decibel.org (noel.decibel.org [67.100.216.10]) by postgresql.org (Postfix) with ESMTP id 27C189FB725 for ; Fri, 3 Aug 2007 19:17:47 -0300 (ADT) Received: by noel.decibel.org (Postfix, from userid 1001) id 84A8D5648E; Fri, 3 Aug 2007 17:17:44 -0500 (CDT) Received: (hashcash-sendmail, from uid 1001); Fri, 3 Aug 2007 17:17:42 -0500 Date: Fri, 3 Aug 2007 17:17:42 -0500 From: Decibel! To: Alan Hodgson Cc: pgsql-performance@postgresql.org Subject: Re: cpu throttling Message-ID: <20070803221742.GV25704@nasby.net> References: <200708020914.37180@hal.medialogik.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="5Dr6Wqe9hdyl7LAI" Content-Disposition: inline In-Reply-To: <200708020914.37180@hal.medialogik.com> X-Operating-System: FreeBSD 6.1-RELEASE-p10 amd64 X-Distributed: Join the Effort! http://www.distributed.net User-Agent: Mutt/1.5.13 (2006-08-11) X-Hashcash: 1:20:070803:ahodgson@simkin.ca::InC+OnZsAKuxLFJy:0000000000000000000 0000000000000000000000000aJd X-Hashcash: 1:20:070803:pgsql-performance@postgresql.org::Ia5prMysDgDWHaLE:00000 0000000000000000000000005XOg X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200708/28 X-Sequence-Number: 26158 --5Dr6Wqe9hdyl7LAI Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Aug 02, 2007 at 09:14:37AM -0700, Alan Hodgson wrote: > On Thursday 02 August 2007 09:02, "Bryan Murphy" = =20 > 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. >=20 > select procpid from pg_stat_activity where current_query =20 > like '%stored_proc%' and current_query not like '%pg_stat_activity%'; >=20 > requires stats_command_string to be enabled >=20 > I'm surprised your operating system doesn't automatically lower the prior= ity=20 > 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. --=20 Decibel!, aka Jim Nasby decibel@decibel.org EnterpriseDB http://enterprisedb.com 512.569.9461 (cell) --5Dr6Wqe9hdyl7LAI Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.3 (FreeBSD) iD8DBQFGs6mGdO30qud8SkgRAu6MAJwJ0GhSw1WOtVrBAcm2umZOwgvxhwCeNJv7 9hxwFjR2/O9zm1qShEsWShs= =xBDB -----END PGP SIGNATURE----- --5Dr6Wqe9hdyl7LAI--