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 DE99E9FB357 for ; Mon, 31 Jul 2006 05:07:04 -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 61532-04 for ; Mon, 31 Jul 2006 05:06:35 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.189]) by postgresql.org (Postfix) with ESMTP id 70E0E9FB34E for ; Mon, 31 Jul 2006 05:06:20 -0300 (ADT) Received: by nf-out-0910.google.com with SMTP id p77so411458nfc for ; Mon, 31 Jul 2006 01:06:06 -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:mime-version:content-type:x-google-sender-auth; b=Riu7oAc0Ut/5Yib9GwKIA3PB32nW3wu8U613S3qMC0KStqC4Y4diOTMB4kP5elLaZ8l5ZGho3r3a3DhW01+b2C7VWKerLNN4rwq9nFfexMWvEl+zSC+KvQFTnizmknYp6ra05FcAaqQ4XHSeYx1BATrpM4E8zRkMPsNFJgB531w= Received: by 10.78.203.15 with SMTP id a15mr432735hug; Mon, 31 Jul 2006 01:06:06 -0700 (PDT) Received: by 10.78.32.10 with HTTP; Mon, 31 Jul 2006 01:06:06 -0700 (PDT) Message-ID: Date: Mon, 31 Jul 2006 03:06:06 -0500 From: "Aaron Bono" To: "Postgresql Admin" Subject: Controlling CPU Usage in PostgreSQL MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_40970_21618259.1154333166408" X-Google-Sender-Auth: 7fe9f816ca4933dd X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=2.851 tagged_above=0 required=5 tests=AWL, HTML_10_20, HTML_MESSAGE, SPF_HELO_SOFTFAIL, SPF_SOFTFAIL X-Spam-Level: ** X-Archive-Number: 200607/291 X-Sequence-Number: 22537 ------=_Part_40970_21618259.1154333166408 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline I have a nightly process that runs in production to refresh reports. This process runs fine but takes a significant portion of the CPU for an hour or so. I was wanting to limit this particular process so it does not consume the full CPU while running (unless nothing else needs the CPU cycles anyway). Is there a way I can tell PostgreSQL to give session a low priority so even if it does take the full CPU, it only does so if it would otherwise be idle? This process runs a series of functions so if there is a command I can put at the beginning of each function, that would be ideal. I would rather do it after logging into PostgreSQL and not by limiting the process at the OS level though that may be an option if there is nothing better. Of course, if there are other ways to approach this, I am quite open to alternatives. Thanks, Aaron ================================================================== Aaron Bono Aranya Software Technologies, Inc. http://www.aranya.com ================================================================== ------=_Part_40970_21618259.1154333166408 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline I have a nightly process that runs in production to refresh reports.  This process runs fine but takes a significant portion of the CPU for an hour or so.  I was wanting to limit this particular process so it does not consume the full CPU while running (unless nothing else needs the CPU cycles anyway).

Is there a way I can tell PostgreSQL to give session a low priority so even if it does take the full CPU, it only does so if it would otherwise be idle?  This process runs a series of functions so if there is a command I can put at the beginning of each function, that would be ideal.  I would rather do it after logging into PostgreSQL and not by limiting the process at the OS level though that may be an option if there is nothing better.

Of course, if there are other ways to approach this, I am quite open to alternatives.

Thanks,
Aaron

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