Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id A644A9FB3F1 for ; Thu, 10 May 2007 02:25: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 14778-01 for ; Thu, 10 May 2007 02:24:46 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from crestone.coronasolutions.com (crestone.coronasolutions.com [66.45.104.24]) by postgresql.org (Postfix) with ESMTP id 3D2439FB554 for ; Thu, 10 May 2007 02:05:34 -0300 (ADT) Received: from localhost (localhost.localdomain [127.0.0.1]) by crestone.coronasolutions.com (Postfix) with ESMTP id EA3AD64472A; Wed, 9 May 2007 23:05:23 -0600 (MDT) Received: from crestone.coronasolutions.com ([127.0.0.1]) by localhost (crestone.coronasolutions.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 27642-03; Wed, 9 May 2007 23:05:22 -0600 (MDT) Received: from mac.local (c-71-196-213-0.hsd1.co.comcast.net [71.196.213.0]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by crestone.coronasolutions.com (Postfix) with ESMTP id 284DA644525 for ; Wed, 9 May 2007 23:05:22 -0600 (MDT) Message-ID: <4642A811.9010703@drivefaster.net> Date: Wed, 09 May 2007 23:05:21 -0600 From: Dan Harris User-Agent: Thunderbird 2.0.0.0 (Macintosh/20070326) MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Re: Background vacuum References: <4642A1B3.6030009@swissembedded.com> In-Reply-To: <4642A1B3.6030009@swissembedded.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at coronasolutions.com X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200705/221 X-Sequence-Number: 24611 Daniel Haensse wrote: > Dear list, > > I'm running postgres on a tomcat server. The vacuum is run every hour > (cronjob) which leads to a performance drop of the tomcat applications. > I played around with renice command and I think it is possible to reduce > this effect which a renice. The problem is how can I figure out the PID > of the postmaster performing the vacuum(automated)? Has anybody a nice > solution to change process priority? A shell script, maybe even for java? > While this may technically work, I think it lacks a key point. 'nice' ( at least the versions I'm familiar with ) do not adjust I/O priority. VACUUM is bogging things down because of the extra strain on I/O. CPU usage shouldn't really be much of a factor. Instead, I would recommend looking at vacuum_cost_delay and the related settings to make vacuum lower priority than the queries you care about. This should be a cleaner solution for you. -Dan