Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cgE9H-0000Vl-IQ for pgsql-admin@arkaria.postgresql.org; Tue, 21 Feb 2017 17:22:47 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cgE9H-00032P-5d for pgsql-admin@arkaria.postgresql.org; Tue, 21 Feb 2017 17:22:47 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cgE9G-00031y-7F for pgsql-admin@postgresql.org; Tue, 21 Feb 2017 17:22:46 +0000 Received: from omr1.cc.ipv6.vt.edu ([2607:b400:92:8300:0:c6:2117:b0e] helo=omr1.cc.vt.edu) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cgE9D-00075K-52 for pgsql-admin@postgresql.org; Tue, 21 Feb 2017 17:22:44 +0000 Received: from mr6.cc.vt.edu (mr6.cc.vt.edu [IPv6:2607:b400:92:8500:0:af:2d00:4488]) by omr1.cc.vt.edu (8.14.4/8.14.4) with ESMTP id v1LHMgcR008356 for ; Tue, 21 Feb 2017 12:22:42 -0500 Received: from mail-qk0-f199.google.com (mail-qk0-f199.google.com [209.85.220.199]) by mr6.cc.vt.edu (8.14.7/8.14.7) with ESMTP id v1LHMaUT015198 for ; Tue, 21 Feb 2017 12:22:41 -0500 Received: by mail-qk0-f199.google.com with SMTP id v73so96660113qkv.7 for ; Tue, 21 Feb 2017 09:22:41 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to; bh=r9riJDrsrAwdfwqcogToMXSFFqhGvxcRyEjRB38pJBE=; b=lox1tqXtuJoqkfPo2GbWCkxewtEpBr8R0pMgsVywWLKZWXDV+qJEM1Yempg4Gs3zcU YBmBfgzhDZVB5dHwoyw6+HM9KOmfMEjf0ETgwkIBlPy2Qux3Mvn6z4h0NCf1dsoPLMXq HAKpIm0DDkVfPsBR7kfqGqqAKTzizwpje+eCOyfsgXQWYgls4rmtLvhFCKxuyXkegYbs 4tzDYpETX8J3HKwrz169IzThbDy54Owqtmy++qqqa1uq5LsLZbews5buUCbRz+6MN0fB uFtLZT1F3sxLHpcC+fAt5SxSgyhRXXVvEvf2eZ5lI6f1cAfhQWwcvmPKa1bywdyN25fP SghA== X-Gm-Message-State: AMke39nBhndsMZryGiQvvVTao3u+SSUAjQXuXX0O+1cQtHkBJxTKysqLRlvgvbV6Sea6Bs2J3Uu9mU5b6Cp8IEC5qxszKsyv4x9IVBEu9TI71XvwNF6ri4PpAHzmJRdSKt2fl/spOwRfvPD62FYmvlFhoGyKqTmgEgl87+sJBGzwxP9hNRIy0c3I5F7EIYiZ/hApJ1M= X-Received: by 10.200.41.13 with SMTP id y13mr24319102qty.154.1487697755067; Tue, 21 Feb 2017 09:22:35 -0800 (PST) X-Received: by 10.200.41.13 with SMTP id y13mr24319067qty.154.1487697754760; Tue, 21 Feb 2017 09:22:34 -0800 (PST) Received: from stell.cns.vt.edu ([2001:468:c80:2102:bda2:a0f6:ef5f:e342]) by smtp.gmail.com with ESMTPSA id 13sm14375147qtn.57.2017.02.21.09.22.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Feb 2017 09:22:34 -0800 (PST) Subject: Re: WAL archive space planning? To: Steven Chang References: Cc: pgsql-admin@postgresql.org From: Ray Stell Message-ID: <274927ff-1e85-2ac7-a5fc-68dd033c5126@vt.edu> Date: Tue, 21 Feb 2017 12:22:33 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------7EA1AD9C1272CA4BB822838E" X-Spam-Status: No, score=1.0 required=5.0 tests=HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_SOFTFAIL autolearn=disabled version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mr6.cc.vt.edu X-Pg-Spam-Score: -3.7 (---) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org This is a multi-part message in MIME format. --------------7EA1AD9C1272CA4BB822838E Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 2/21/17 12:09 AM, Steven Chang wrote: > check this, his 2nd part introduces Stream Replication Implementation > and tell you px_log retention and wal archive related parameters. > https://www.itenlight.com/blog/2016/05/19/PostgreSQL+HA+with+pgpool-II+-+Part+2 > > > 2017-02-18 2:30 GMT+08:00 Ray Stell >: > > I was "planning" to turn on WAL archiving on a postgresql 9.4.11 > server that currently is running with "wal_level=hot_standby" and > streaming to a standby. I thought there would be a relationship > between the rate of pg_xlog files and archive generation. When I > turned up the archive_command/mode I found the scale of the > archive target was wrong as I had based it on the pg_xlog file > creation rate. > > When I turned on the archive command for a few minutes, pg_xlog > dir contained these files for the time period: > > -rw------- 1 postgres postgres 16777216 Feb 17 06:47 > 00000001000023AC0000007F > -rw------- 1 postgres postgres 16777216 Feb 17 06:45 > 00000001000023AC0000007E > > The archive command wrote 126, 16MB files: > > -rw------- 1 postgres postgres 16777216 Feb 17 06:47 > 000000010000237700000056 > -rw------- 1 postgres postgres 16777216 Feb 17 06:47 > 000000010000237700000055 > -rw------- 1 postgres postgres 16777216 Feb 17 06:47 > 000000010000237700000054 > -rw------- 1 postgres postgres 16777216 Feb 17 06:47 > 000000010000237700000053 > ... > > -rw------- 1 postgres postgres 16777216 Feb 17 06:45 > 0000000100002376000000DC > -rw------- 1 postgres postgres 16777216 Feb 17 06:45 > 0000000100002376000000DB > -rw------- 1 postgres postgres 16777216 Feb 17 06:45 > 0000000100002376000000DA > -rw------- 1 postgres postgres 16777216 Feb 17 06:45 > 0000000100002376000000D9 > > On servers that are not nearly as busy, I observe a one-to-one > relationship between these files/rates. > > Is there a good WAL archive space planning guide? > > Is the way to collect planning data for this to turn on wal_debug? > > TIA! > > > > > -- > Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org > ) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-admin > > > I'm interested in why I might observed a dramatic difference between pg_xlog files and the archive target files. Other dbs I see have them pretty much one-to-one, but not in this case here. What might cause the large variation? I got only a few pg_xlogs files each minute and 42 archive files/min. --------------7EA1AD9C1272CA4BB822838E Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit

On 2/21/17 12:09 AM, Steven Chang wrote:

check this, his 2nd part introduces Stream Replication Implementation and tell you px_log retention and wal archive related parameters.

2017-02-18 2:30 GMT+08:00 Ray Stell <stellr@vt.edu>:
I was "planning" to turn on WAL archiving on a postgresql 9.4.11 server that currently is running with "wal_level=hot_standby" and streaming to a standby.  I thought there would be a relationship between the rate of pg_xlog files and archive generation.   When I turned up the archive_command/mode I found the scale of the archive target was wrong as I had based it on the pg_xlog file creation rate.

When I turned on the archive command for a few minutes, pg_xlog dir contained these files for the time period:

-rw------- 1 postgres postgres 16777216 Feb 17 06:47 00000001000023AC0000007F
-rw------- 1 postgres postgres 16777216 Feb 17 06:45 00000001000023AC0000007E

The archive command wrote 126, 16MB files:

-rw------- 1 postgres postgres 16777216 Feb 17 06:47 000000010000237700000056
-rw------- 1 postgres postgres 16777216 Feb 17 06:47 000000010000237700000055
-rw------- 1 postgres postgres 16777216 Feb 17 06:47 000000010000237700000054
-rw------- 1 postgres postgres 16777216 Feb 17 06:47 000000010000237700000053
...

-rw------- 1 postgres postgres 16777216 Feb 17 06:45 0000000100002376000000DC
-rw------- 1 postgres postgres 16777216 Feb 17 06:45 0000000100002376000000DB
-rw------- 1 postgres postgres 16777216 Feb 17 06:45 0000000100002376000000DA
-rw------- 1 postgres postgres 16777216 Feb 17 06:45 0000000100002376000000D9

On servers that are not nearly as busy, I observe a one-to-one relationship between these files/rates.

Is there a good WAL archive space planning guide?

Is the way to collect planning data for this to turn on wal_debug?

TIA!




--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

I'm interested in why I might observed a dramatic difference between pg_xlog files and the archive target files. Other dbs I see have them pretty much one-to-one, but not in this case here.  What might cause the large variation?  I got only a few pg_xlogs files each minute and 42 archive files/min.  
--------------7EA1AD9C1272CA4BB822838E--