Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 04666B5DBC8 for ; Mon, 11 Jul 2011 01:47:46 -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 83169-02 for ; Mon, 11 Jul 2011 04:47:35 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from nm28-vm2.bullet.mail.ne1.yahoo.com (nm28-vm2.bullet.mail.ne1.yahoo.com [98.138.91.128]) by mail.postgresql.org (Postfix) with SMTP id E2011B5DBC4 for ; Mon, 11 Jul 2011 01:47:34 -0300 (ADT) Received: from [98.138.90.54] by nm28.bullet.mail.ne1.yahoo.com with NNFMP; 11 Jul 2011 04:47:33 -0000 Received: from [98.138.89.165] by tm7.bullet.mail.ne1.yahoo.com with NNFMP; 11 Jul 2011 04:47:33 -0000 Received: from [127.0.0.1] by omp1021.mail.ne1.yahoo.com with NNFMP; 11 Jul 2011 04:47:33 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 863612.82871.bm@omp1021.mail.ne1.yahoo.com Received: (qmail 95734 invoked by uid 60001); 11 Jul 2011 04:47:33 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1310359653; bh=vGlwODlvwUKnYtNAwsbwUwOnvtXMSpVGobCCI8OzNP0=; h=X-YMail-OSG:Received:X-Mailer:References:Message-ID:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=pTtu7O9siHpgJS8O9SQ3a3g36v6fqnvWhegnkbeQfrc6xlt4neCw3gMx+V8f5SmNSp5mtpevxi34xG5SwA6ihuf7L4sgTtQUwj+FOdfPKg3WO7w2Ovh/afprZKmoFSjVv0x35Zn1w7y6J+rNZebmRnN1L3VgTLkZMKLRVuLZJeo= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Mailer:References:Message-ID:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=fxkN/ySxFWLpTqJgCY8OS4PXCK6sow4b/wAasBmDQwLOnEpZjC2ZM1A5M/PpahSKpPgPXppErBJdrUBj45FpeB+la5JKu4/XbQtCd6gQ2c/aATpwohW+NZpSlNA7v+0Tr83alWisizlu4hx46Wgpc42bFt3fXtOG3qX2c5fZBuU=; X-YMail-OSG: wnH6LscVM1ktGqannsXZ6Dve8aqPH6sDPzlwBKKU_5xlWwv MGcDgLs9SQ5y110nIWn0htRc2x64Yh4KXPBXooM5cer6bGy3SAZQ6pggYRDO qtQPmAMu5cnBOC8x.8nRz.QiLsq5cSewryw0ypRKAgFnVlaQ51AhnnjsrzNS E1c_yAQ5KXYhzpnwGG1I.CUFnDzLn32Wls_cFbDsg_v60ZGOXOe4LZu84_E9 tHwcigWJ5bPK4MtBFpIfDtmVY.hBrk.wwQ4eAhD_bkPqzneO38UwapUm2mXA Ij1WZC.FSne5Dbh7cIrjRvfC9mdQEe4OKGdC8d1Z.GgwHx0EJGvdIWyO5fim D9jAYmJng4zcmC4gWz7yZTWoByBRsNL8MHnhmB7lGZjNwscHRTOz05kjQpMq Xaoc_7KO9vHCSJZ_EqpL0ODiu4Vb._osqKaPfRXlhpGaeaOzeopAwJh5JZQf 1RZGFljZ7ZsqhJV8VXw-- Received: from [67.170.234.149] by web121705.mail.ne1.yahoo.com via HTTP; Sun, 10 Jul 2011 21:47:33 PDT X-Mailer: YahooMailRC/572 YahooMailWebService/0.8.112.307740 References: <4E16479D.3050605@yahoo.com> <4E1A0CBC.6090009@yahoo.com> <4E1A31AB.9010201@postnewspapers.com.au> Message-ID: <1310359653.80687.YahooMailRC@web121705.mail.ne1.yahoo.com> Date: Sun, 10 Jul 2011 21:47:33 -0700 (PDT) From: lars hofhansl Subject: Re: UPDATEDs slowing SELECTs in a fully cached database To: Craig Ringer , pgsql-performance@postgresql.org In-Reply-To: <4E1A31AB.9010201@postnewspapers.com.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.909 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201107/93 X-Sequence-Number: 44305 Thanks Craig. Yep, I am not seeing the SELECTs slow down (measurably) during checkpoints (i.e. when dirty pages are flushed to disk), but only during writing of the WAL files. The buffers shared and OS are big enough to hold the entire database, so evicting cached data should not be necessary. (The database including indexes can fit into 16 or so GB, and I have 68GB on that machine). Interestingly I initially thought there might be a correlation between checkpointing and slower SELECTs, but it turns out that checkpointing just slowed down IO to the WAL - until I move it to its own drive, and then increased the effect I was seeing. I'll do more research and try to provide more useful details. Thanks for the pg_catalog link, I'll have a look at it. -- Lars ----- Original Message ---- From: Craig Ringer To: pgsql-performance@postgresql.org Sent: Sun, July 10, 2011 4:11:39 PM Subject: Re: [PERFORM] UPDATEDs slowing SELECTs in a fully cached database On 11/07/2011 4:34 AM, lars wrote: > I have since moved the WAL to its own EBS volume (ext4, data=writeback) > to make it easier to monitor IO. > The times where the SELECTs slow down coincide with heavy write traffic > to the WAL volume. In theory, UPDATEs shouldn't be blocking or slowing SELECTs. Whether that holds up to the light of reality, real-world hardware, and software implementation detail, I really don't know. I avoided responding to your first mail because I generally work with smaller and less performance critical databases so I haven't accumulated much experience with fine-tuning. If your SELECTs were slower *after* your UPDATEs I'd be wondering if your SELECTs are setting hint bits on the pages touched by the UPDATEs. See: http://wiki.postgresql.org/wiki/Hint_Bits . It doesn't sound like that's the case if the SELECTs are slowed down *during* a big UPDATE that hasn't yet committed, though. Could it just be cache pressure - either on shm, or operating system disk cache? All the dirty buffers that have to be flushed to WAL and to the heap may be evicting cached data your SELECTs were benefitting from. Unfortunately, diagnostics in this area are ... limited ... though some of the pg_catalog views (http://www.postgresql.org/docs/9.0/static/catalogs.html) may offer some information. -- Craig Ringer POST Newspapers 276 Onslow Rd, Shenton Park Ph: 08 9381 3088 Fax: 08 9388 2258 ABN: 50 008 917 717 http://www.postnewspapers.com.au/ -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance