Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id D77A5633787 for ; Thu, 5 Nov 2009 07:32:51 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 29459-06 for ; Thu, 5 Nov 2009 11:32:43 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-iw0-f186.google.com (mail-iw0-f186.google.com [209.85.223.186]) by mail.postgresql.org (Postfix) with ESMTP id E3D3F632F0D for ; Thu, 5 Nov 2009 07:32:43 -0400 (AST) Received: by iwn16 with SMTP id 16so5455879iwn.29 for ; Thu, 05 Nov 2009 03:32:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:from:date:x-google-sender-auth:message-id:subject:to:cc :content-type:content-transfer-encoding; bh=KXtUOqZEYawO1A1nX7/DLzd5+0tDWxoZCvYzsHrRUYk=; b=GP6rNQz9uosANUiAqMSOlAdfzqkTwgQd1JaOyH7LjymM43Aeq59ZabKLWWS+Lfj786 M1aJu44cmW7vDRbpnGG8RT1hNlgbC7/kRfi3XEzF/e1fVSckbzKmu0TQ18rlGSfdMKDU 0DKsjGOTE+v07I+uEztM/k2gqdUBMF8AQJKEA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; b=vTPzFoYia9/UdMEIrbPpWQBAlqUr5glloaSy5QFHYST0vdG8WGC8ICMxHA7ZqIuC0n lzokqy2TZnlt4g0Ee5jp9kxnvwDMKz4ovpiQTtEE4eWMRPEHvYLd7mBejunY7zOnCuP0 D01kX4rA0LHJsjFrDgV37ywcGo9zpFzQO8XRA= MIME-Version: 1.0 Received: by 10.231.9.218 with SMTP id m26mr4432214ibm.29.1257420762069; Thu, 05 Nov 2009 03:32:42 -0800 (PST) In-Reply-To: <2f4958ff0911050138n3f246b7ck6182cb702ac48e91@mail.gmail.com> References: <2f4958ff0911050138n3f246b7ck6182cb702ac48e91@mail.gmail.com> From: Greg Stark Date: Thu, 5 Nov 2009 11:32:22 +0000 X-Google-Sender-Auth: f94c12e1c7662b2f Message-ID: <407d949e0911050332n5ef355c1y156dcd26aa28d222@mail.gmail.com> Subject: Re: Running some query in low priority To: =?ISO-8859-2?Q?Grzegorz_Ja=B6kiewicz?= Cc: S Arvind , pgsql-performance@postgresql.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-10 required=5 tests=BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 200911/63 X-Sequence-Number: 36231 2009/11/5 Grzegorz Ja=C5=9Bkiewicz : > > > On Thu, Nov 5, 2009 at 9:36 AM, S Arvind wrote: >> >> Hi Developers and Tuners, >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Is there any way to run= some query in low priority and some query >> in higher priority in pg. The main reason for this is i need my main >> application(high priority) to be undisturbed by the sub application(low >> priority) which is running on same DB. Is there anyother good way to ope= rate >> this? > > other than manually re-nicing back end, no. And unfortunately this doesn't really work very well. renicing only affects cpu priority and usually it's i/o priority you want to adjust. Even if you can adjust i/o priority per process on your operating system the database often does i/o work for one process in another process or has times when a process is waiting on another process to finish i/o. So lowering the i/o priority of the low priority process might not have the desired effect of speeding up other processes. Usually this isn't a problem unless you have a large batch load or something like that happening which consumes all available i/o. In that case you can sometimes reduce the i/o demand by just throttling the rate at which you send data to or read data from the server. --=20 greg