X-Original-To: pgsql-admin-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id B81849FB228 for ; Wed, 2 Aug 2006 14:43:16 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 72032-08 for ; Wed, 2 Aug 2006 14:43:04 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.190]) by postgresql.org (Postfix) with ESMTP id D8CD79FA4A8 for ; Wed, 2 Aug 2006 14:43:04 -0300 (ADT) Received: by nf-out-0910.google.com with SMTP id p77so742166nfc for ; Wed, 02 Aug 2006 10:43:02 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:references:x-google-sender-auth; b=Fxdb0SoiUDo6UrXSZoFnnGsZmSHE0blTZqUj+ic+3dRG38VID2Q8U5k9H8GcttM+SMfTrKDPRqc9cTkrQHpCdRQXBoylPTuPgiEvi2VHAuDPtNSDc1Sm6OrnIu2pxlZjN//asZCn2fZokfSSNtlFG6cIGgJ+vPsFEv76M+Nwlmo= Received: by 10.78.150.7 with SMTP id x7mr437892hud; Wed, 02 Aug 2006 10:43:01 -0700 (PDT) Received: by 10.78.32.10 with HTTP; Wed, 2 Aug 2006 10:43:01 -0700 (PDT) Message-ID: Date: Wed, 2 Aug 2006 12:43:01 -0500 From: "Aaron Bono" To: "Chris Mair" Subject: Re: Controlling CPU Usage in PostgreSQL Cc: pgsql-admin@postgresql.org In-Reply-To: <1154469364.3800.2.camel@dell.home.lan> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_94024_9712770.1154540581883" References: <200607311101.36629.mlists@rp-online.de> <1154460151.7882.7.camel@state.g2switchworks.com> <1154469364.3800.2.camel@dell.home.lan> X-Google-Sender-Auth: 588798da6fb56462 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.657 tagged_above=0 required=5 tests=AWL, HTML_30_40, HTML_MESSAGE, SPF_PASS X-Spam-Level: X-Archive-Number: 200608/25 X-Sequence-Number: 22569 ------=_Part_94024_9712770.1154540581883 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 8/1/06, Chris Mair wrote: > > On Tue, 2006-08-01 at 14:22 -0500, Scott Marlowe wrote: > > On Tue, 2006-08-01 at 13:59, Aaron Bono wrote: > > > Is there a way to tell PostgreSQL to change the nice value of a > > > particular connection? I guess I could use renice but that means a > > > lot of shell scripting to determine what PID to change - I am not a > > > shell script expert and would rather not pursue that option. > > > > This is one of those things that only seems like a good idea at the > > time. > > > > While nice-ing the whole of a postgresql server is doable, nice-ing > > individual connections is no advisable. > > > > You can reach a bad state caused by "priority inversion". Search the > > lists (not just admin) for that phrase and you should find out what I > > mean. This should probably be a FAQ, as it shows up every few months. > > I started going down that same road in May... here's the thread from > then explaining why it's a bad idea after all: > http://archives.postgresql.org/pgsql-performance/2006-05/msg00462.php I didn't really have my heart set on doing this, just was wondering if I could and how. This has been a good eye opener though. It will definitely have an impact on my future design of both the database and multi-threaded applications. Thanks guys! ================================================================== Aaron Bono Aranya Software Technologies, Inc. http://www.aranya.com ================================================================== ------=_Part_94024_9712770.1154540581883 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline On 8/1/06, Chris Mair <list@1006.org> wrote:
On Tue, 2006-08-01 at 14:22 -0500, Scott Marlowe wrote:
> On Tue, 2006-08-01 at 13:59, Aaron Bono wrote:
> > Is there a way to tell PostgreSQL to change the nice value of a
> > particular connection?  I guess I could use renice but that means a
> > lot of shell scripting to determine what PID to change - I am not a
> > shell script expert and would rather not pursue that option.
>
> This is one of those things that only seems like a good idea at the
> time.
>
> While nice-ing the whole of a postgresql server is doable, nice-ing
> individual connections is no advisable.
>
> You can reach a bad state caused by "priority inversion".  Search the
> lists (not just admin) for that phrase and you should find out what I
> mean.  This should probably be a FAQ, as it shows up every few months.

I started going down that same road in May... here's the thread from
then explaining why it's a bad idea after all:
http://archives.postgresql.org/pgsql-performance/2006-05/msg00462.php

 
I didn't really have my heart set on doing this, just was wondering if I could and how.

This has been a good eye opener though.  It will definitely have an impact on my future design of both the database and multi-threaded applications.

Thanks guys!

==================================================================
   Aaron Bono
   Aranya Software Technologies, Inc.
   http://www.aranya.com
================================================================== ------=_Part_94024_9712770.1154540581883--