Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id C39F316DA9CF for ; Fri, 11 Nov 2011 05:54:34 -0400 (AST) 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 82276-07 for ; Fri, 11 Nov 2011 09:54:27 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from mail-out1.uio.no (mail-out1.uio.no [129.240.10.57]) by mail.postgresql.org (Postfix) with ESMTP id 84B2416DA9CE for ; Fri, 11 Nov 2011 05:54:27 -0400 (AST) Received: from mail-mx5.uio.no ([129.240.10.46]) by mail-out1.uio.no with esmtp (Exim 4.75) (envelope-from ) id 1ROnoY-0006bw-HM; Fri, 11 Nov 2011 10:54:26 +0100 Received: from 84.122.25.226.dyn.user.ono.com ([84.122.25.226] helo=[10.2.2.101]) by mail-mx5.uio.no with esmtpsa (TLSv1:CAMELLIA256-SHA:256) user rafael (Exim 4.76) (envelope-from ) id 1ROnoX-0004zb-Sq; Fri, 11 Nov 2011 10:54:26 +0100 Message-ID: <4EBCF0C3.1040608@usit.uio.no> Date: Fri, 11 Nov 2011 10:54:11 +0100 From: Rafael Martinez User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.23) Gecko/20110922 Thunderbird/3.1.15 MIME-Version: 1.0 To: Greg Smith CC: pgsql-performance@postgresql.org Subject: Re: WAL partition filling up after high WAL activity References: <4EBAA516.2070307@2ndQuadrant.com> In-Reply-To: <4EBAA516.2070307@2ndQuadrant.com> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-UiO-Ratelimit-Test: rcpts/h 2 msgs/h 1 sum rcpts/h 3 sum msgs/h 2 total rcpts 3287 max rcpts/h 19 ratelimit 0 X-UiO-Spam-info: not spam, SpamAssassin (score=-8.0, required=5.0, autolearn=disabled, TVD_RCVD_IP=0.001, UIO_MAIL_IS_INTERNAL=-5, UIO_PGP_SIGNED=-3, uiobl=NO, uiouri=NO) X-UiO-Scanned: 4198762BFA0964B7DF2137ADBC019C36CD771FB4 X-UiO-SPAM-Test: remote_host: 84.122.25.226 spam_score: -79 maxlevel 80 minaction 2 bait 0 mail/h: 1 total 110 max/h 4 blacklist 0 greylist 0 ratelimit 0 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-3.101 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RP_MATCHES_RCVD=-1.201 X-Spam-Level: X-Archive-Number: 201111/135 X-Sequence-Number: 45646 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 11/09/2011 05:06 PM, Greg Smith wrote: > On 11/07/2011 05:18 PM, Richard Yen wrote: >> My biggest question is: we know from the docs that there should be no >> more than (2 + checkpoint_completion_target) * checkpoint_segments + 1 >> files. For us, that would mean no more than 48 files, which equates >> to 384MB--far lower than the 9.7GB partition size. **Why would WAL >> use up so much disk space?** >> > > That's only true if things are operating normally. There are at least > two ways this can fail to be a proper upper limit on space used: > > 1) You are archiving to a second system, and the archiving isn't keeping > up. Things that haven't been archived can't be re-used, so more disk > space is used. > > 2) Disk I/O is slow, and the checkpoint writes take a significant period > of time. The internal scheduling assumes each individual write will > happen without too much delay. That assumption can easily be untrue on > a busy system. The worst I've seen now are checkpoints that take 6 > hours to sync, where the time is supposed to be a few seconds. Disk > space in that case was a giant multiple of checkpoint_segments. (The > source of that problem is very much improved in PostgreSQL 9.1) > Hello We have a similar case in june but we did not find the cause of our problem. More details and information: http://archives.postgresql.org/pgsql-docs/2011-06/msg00007.php Your explanation in 2) sounds like a good candidate for the problem we had. As I said in june, I think we need to improve the documentation in this area. A note in the documentation about what you have explained in 2) with maybe some hints about how to find out if this is happening will be a great improvement. We did not understand why we experienced this problem in june when creating a GIN index on a tsvector column. But we found out that a lot of the tsvector data was generated from "garbage" data (base64 encoding of huge attachments). When we generated the right tsvector data, the creation of the GIN index ran smoothly and the problem with extra WAL files disappeared. PS.- In our case, the disk space used by all the extra WAL files was almost the equivalent to the 17GB of our GIN index. regards, - -- Rafael Martinez Guerrero Center for Information Technology University of Oslo, Norway PGP Public Key: http://folk.uio.no/rafael/ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk688LoACgkQBhuKQurGihTbvQCfaSBdYNF2oOtErcx/e4u0Zw1J pLIAn2Ztdbuz33es2uw8ddSIjj8UXe3s =olkD -----END PGP SIGNATURE-----