Received: from maia.hub.org (unknown [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id BF6691337BA7 for ; Thu, 21 Oct 2010 12:07:30 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 12669-02-6 for ; Thu, 21 Oct 2010 15:07:23 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from aoskar.kilobug.org (kilobug.org [62.212.118.231]) by mail.postgresql.org (Postfix) with ESMTP id 26F2C1337B78 for ; Thu, 21 Oct 2010 12:07:17 -0300 (ADT) Received: from kilobug by aoskar.kilobug.org with local (Exim 4.72) (envelope-from ) id 1P8wjZ-000757-Fz; Thu, 21 Oct 2010 17:07:13 +0200 From: Gael Le Mignot To: Leonardo Francalanci Cc: Gael Le Mignot , pgsql-performance@postgresql.org Subject: Re: Periodically slow inserts Organization: Pilot Systems References: <857928.20870.qm@web29002.mail.ird.yahoo.com> Mail-Copies-To: nobody X-Revolutionnary-Date: 30 =?iso-8859-1?Q?Vend=E9miaire?= an 219 de la =?iso-8859-1?Q?R=E9volution?= X-PGP-Fingerprint: 1F2C 9804 7505 79DF 95E6 7323 B66B F67B 7103 C5DA Date: Thu, 21 Oct 2010 17:07:13 +0200 In-Reply-To: <857928.20870.qm@web29002.mail.ird.yahoo.com> (Leonardo Francalanci's message of "Thu, 21 Oct 2010 14:15:40 +0100 (BST)") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201010/345 X-Sequence-Number: 40763 Hello Leonardo! Thu, 21 Oct 2010 14:15:40 +0100 (BST), you wrote: >> We are using PostgreSQL for storing data and full-text search indexes >> for the webiste of a daily newspaper. We are very happy overall with the >> results, but we have one "weird" behaviour that we would like to solve. > I think there's a lot of missing info worth knowing: > 1) checkpoints logs? Enable them, maybe the "slowness" happens > at checkpoints: > log_checkpoints=true Yes, it's the checkpoints. The delay is the delay of the "sync" part of the checkpoints : 2010-10-21 16:39:15 CEST LOG: checkpoint complete: wrote 365 buffers (11.9%); 0 transaction log file(s) added, 0 removed, 3 recycled; write=0.403 s, sync=21.312 s, total=21.829 s Maybe there is something I misunderstood, but aren't the checkpoints supposed to run smoothly over the checkpoint_completion_target interval ? Is there any way to smooth it over time ? > 2) How many rows does each table contain? The problems occur on the "big" table with around 570 000 rows. Sorry I forgot that information. > 3) HW: how many discs you have, and which controller you're using (and: > does it use a BBU?) 2 SAS 15K disks in RAID1 (Linux software RAID). The controller is LSI SAS1068E PCI-Express Fusion-MPT SAS, and we did enable the write cache (sdparm says : WCE 1 [cha: y] ). Not sure if it has a BBU, but we have redundant power supply, and when we'll go live, we'll have a warm standby on different hardware through WAL log shipping (it's not in place right now), and we can afford a few minutes of dataloss in case of exceptional failure. > The more you tell the list, the better help you'll get... Of course, thanks for your feedback. As for the othe questions of the Wiki page : - I don't think explain/explain analyze will provide any information for inserts with no subqueries/... - We have (Debian) default config for autovacuum, and I tried a "vacuum analyze;" just before running a bench, it didn't change anything. - I tried moving the WAL to another pair of similar RAID1 SAS disks, but it didn't have any significant effect. And I also forgot to give the PostgreSQL version, it's 8.4.4 from Debian backports. Regards, -- Gaël Le Mignot - gael@pilotsystems.net Pilot Systems - 9, rue Desargues - 75011 Paris Tel : +33 1 44 53 05 55 - www.pilotsystems.net Gérez vos contacts et vos newsletters : www.cockpit-mailing.com