Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id DFA04B5DBE5 for ; Wed, 7 Sep 2011 03:54:38 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 45707-01-4 for ; Wed, 7 Sep 2011 06:54:32 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-fx0-f46.google.com (mail-fx0-f46.google.com [209.85.161.46]) by mail.postgresql.org (Postfix) with ESMTP id 25B81B5D80A for ; Wed, 7 Sep 2011 03:54:29 -0300 (ADT) Received: by fxh19 with SMTP id 19so274042fxh.19 for ; Tue, 06 Sep 2011 23:54:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=N0aMbXTI+QsXYNYUr1GOeIX3V23cgkcu0x0g/qiR31o=; b=mgRVCvDwEZKPT/noAqvTH2zpv4J4DQBC2c6P0JqwuqVL2/OiDC07Ed3mdY153++4JX BqOMQK74hCVU4dh5noSBIsyIHQZV4dprITdI/R5CM40NKsSWSVuDE7igbnZTcVFYoqfS tC4I06FD1ep+L8HxzjlirGQxrHjuMIypi+Wv0= Received: by 10.223.17.3 with SMTP id q3mr1528331faa.71.1315378468484; Tue, 06 Sep 2011 23:54:28 -0700 (PDT) Received: from [10.64.1.26] ([94.45.140.16]) by mx.google.com with ESMTPS id d25sm866518fak.7.2011.09.06.23.54.26 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 06 Sep 2011 23:54:27 -0700 (PDT) Message-ID: <4E671521.3090406@gmail.com> Date: Wed, 07 Sep 2011 09:54:25 +0300 From: Vitalii Tymchyshyn User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.18) Gecko/20110617 Lightning/1.0b2 Thunderbird/3.1.11 MIME-Version: 1.0 To: Richard Shaw CC: Alan Hodgson , pgsql-performance@postgresql.org Subject: Re: Rather large LA References: <4E64D0FE.6020704@squeakycode.net> <97BCA6CA-A1DB-43C7-B710-C2836B656FD6@aggress.net> <201109051305.07010@hal.medialogik.com> <9BFA2771-CA9B-4EEF-B671-78FF67F749C6@aggress.net> In-Reply-To: <9BFA2771-CA9B-4EEF-B671-78FF67F749C6@aggress.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.799 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_ENVFROM_END_DIGIT=0.1, FREEMAIL_FROM=0.001 X-Spam-Level: X-Archive-Number: 201109/74 X-Sequence-Number: 44850 Hello. As it turned out to be iowait, I'd recommend to try to load at least some hot relations into FS cache with dd on startup. With a lot of RAM on FreeBSD I even sometimes use this for long queries that require a lot of index scans. This converts random IO into sequential IO that is much much faster. You can try it even while your DB starting - if it works you will see IOwait drop and user time raise. What I do on FreeBSD (as I don't have enough RAM to load all the DB into RAM) is: 1) ktrace on backend process[es]. Linux seems to have similar tool 2) Find files that take a lot of long reads 3) dd this files to /dev/null In this way you can find hot files. As soon as you have them (or if you can afford to load everything), you can put dd into startup scripts. Or I can imagine an automatic script that will do such things for some time after startup. Best regards, Vitalii Tymchyshyn