Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Z57ho-0002iy-Be for pgsql-general@arkaria.postgresql.org; Wed, 17 Jun 2015 07:24:16 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Z57hn-0005hM-IT for pgsql-general@arkaria.postgresql.org; Wed, 17 Jun 2015 07:24:15 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Z57hg-0005X1-9x for pgsql-general@postgresql.org; Wed, 17 Jun 2015 07:24:08 +0000 Received: from mail-wi0-x22d.google.com ([2a00:1450:400c:c05::22d]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1Z57hc-0003BN-LP for pgsql-general@postgresql.org; Wed, 17 Jun 2015 07:24:07 +0000 Received: by wiga1 with SMTP id a1so129737388wig.0 for ; Wed, 17 Jun 2015 00:24:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-type; bh=4lgtpqf852Wb4blJ4n5lz2gkJnPC2a/vEkJFF1g8rbc=; b=kRfXypdWBulRNU7B1TsYhwGX5qdNuQkxoeq7z06taDpX5zJE6WMN96TT1LqFKzdpDe 6HGqqUxVuVtEq71z/3oBA+HsHUoV+J22O1tTLqCiTDARcqy5HypcRrPHfVkyyD6ZoVxh kvpdmm4RCyf1rA/8LjZuwBjv0e42Aox+gVqUDM1pi7TSlpB5k0NujqwlJfqZp8fhSVt0 4vF5XGPPiGS4dr0OsZGHhfrsR1lGN5XLmq40Sjbevce3+8RqQ9EFce9UIrs11uopzD+2 NVWPZwgAs6Yqa9bKrwP7I17R2u2HL9ASNt/VFZNM8Za3iatTGApgxpqDBi321rhgHL3L Alww== X-Received: by 10.194.79.73 with SMTP id h9mr3081944wjx.125.1434525841446; Wed, 17 Jun 2015 00:24:01 -0700 (PDT) Received: from [10.3.255.188] (pir44-4-88-177-221-225.fbx.proxad.net. [88.177.221.225]) by mx.google.com with ESMTPSA id um5sm5239409wjc.1.2015.06.17.00.24.00 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Jun 2015 00:24:00 -0700 (PDT) Subject: Re: pg_xlog on a hot_stanby slave To: Sameer Kumar , pgsql-general@postgresql.org References: From: Xavier 12 Message-ID: <5581208E.7010205@gmail.com> Date: Wed, 17 Jun 2015 09:23:58 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:38.0) Gecko/20100101 Thunderbird/38.0.1 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------080702070209050803000308" X-Pg-Spam-Score: -2.7 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-general Precedence: bulk Sender: pgsql-general-owner@postgresql.org This is a multi-part message in MIME format. --------------080702070209050803000308 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 17/06/2015 03:17, Sameer Kumar wrote: > > > On Tue, 16 Jun 2015 16:55 Xavier 12 > wrote: > > Hi everyone, > > Questions about pg_xlogs again... > I have two Postgresql 9.1 servers in a master/slave stream replication > (hot_standby). > > Psql01 (master) is backuped with Barman and pg_xlogs is correctly > purged (archive_command is used). > > Hower, Psql02 (slave) has a huge pg_xlog (951 files, 15G for 7 days > only, it keeps growing up until disk space is full). I have found > documentation and tutorials, mailing list, but I don't know what is > suitable for a Slave. Leads I've found : > > - checkpoints > - archive_command > - archive_cleanup > > Master postgresq.conf : > > [...] > wal_level = 'hot_standby' > archive_mode = on > archive_command = 'rsync -az /var/lib/postgresql/9.1/main/pg_xlog/%f > barman@nas.lan:/data/pgbarman/psql01/incoming/%f' > max_wal_senders = 5 > wal_keep_segments = 64 > > > What's this parameter's value on Slave? > Hm... You have a point. That autovacuum parameter seems to be useless on a slave. I'll try to remove it and check pg_xlog. Xavier C. > > autovacuum = on > > Slave postgresql.conf : > > [...] > wal_level = minimal > wal_keep_segments = 32 > hot_standby = on > > Slave recovery.conf : > > standby_mode = 'on' > primary_conninfo = 'host=10.0.0.1 port=5400 user=postgres' > trigger_file = '/var/lib/postgresql/9.1/triggersql' > restore_command='cp /var/lib/postgresql/9.1/wal_archive/%f "%p"' > archive_cleanup_command = > '/usr/lib/postgresql/9.1/bin/pg_archivecleanup > /var/lib/postgresql/9.1/wal_archive/ %r' > > > > How can I reduce the number of WAL files on the hot_stanby slave ? > > Thanks > > Regards. > > Xavier C. > > -- > Sent via pgsql-general mailing list (pgsql-general@postgresql.org > ) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-general > > --------------080702070209050803000308 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit

On 17/06/2015 03:17, Sameer Kumar wrote:


On Tue, 16 Jun 2015 16:55 Xavier 12 <maniatux@gmail.com> wrote:

Hi everyone,

Questions about pg_xlogs again...
I have two Postgresql 9.1 servers in a master/slave stream replication
(hot_standby).

Psql01 (master) is backuped with Barman and pg_xlogs is correctly
purged (archive_command is used).

Hower, Psql02 (slave) has a huge pg_xlog (951 files, 15G for 7 days
only, it keeps growing up until disk space is full). I have found
documentation and tutorials, mailing list, but I don't know what is
suitable for a Slave. Leads I've found :

- checkpoints
- archive_command
- archive_cleanup

Master postgresq.conf :

[...]
wal_level = 'hot_standby'
archive_mode = on
archive_command = 'rsync -az /var/lib/postgresql/9.1/main/pg_xlog/%f
barman@nas.lan:/data/pgbarman/psql01/incoming/%f'
max_wal_senders = 5
wal_keep_segments = 64


What's this parameter's value on Slave?


Hm... You have a point.
That autovacuum parameter seems to be useless on a slave.
I'll try to remove it and check pg_xlog.

Xavier C.


autovacuum = on

Slave postgresql.conf :

[...]
wal_level = minimal
wal_keep_segments = 32
hot_standby = on

Slave recovery.conf :

standby_mode = 'on'
primary_conninfo = 'host=10.0.0.1 port=5400 user=postgres'
trigger_file = '/var/lib/postgresql/9.1/triggersql'
restore_command='cp /var/lib/postgresql/9.1/wal_archive/%f "%p"'
archive_cleanup_command =
'/usr/lib/postgresql/9.1/bin/pg_archivecleanup
/var/lib/postgresql/9.1/wal_archive/ %r'



How can I reduce the number of WAL files on the hot_stanby slave ?

Thanks

Regards.

Xavier C.

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



--------------080702070209050803000308--