Re: WAL archive (archive_mode = always) ?

From: Narayanan V <vnarayanan(dot)email(at)gmail(dot)com>
To: adelino(dot)j(dot)silva(at)googlemail(dot)com
Cc: tsunakawa(dot)takay(at)jp(dot)fujitsu(dot)com, pgsql-hackers(at)postgresql(dot)org
Subject: Re: WAL archive (archive_mode = always) ?
Date: 2018-10-22 09:46:36
Message-ID: CAJP1NzNj8CgY7YhtS+zgpWjw=RFOa2my04bJOvOEwNperA+7KA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I think what Takayuki is trying to say is that streaming replication works
by sending the contents of the WAL archives to the standbys. If
archive_mode was NOT set to always, and if you wanted to archive WAL logs
in the standby you would need to rely on the process_command and make it
ship the WAL logs (to the standby). This causes the same WAL log
information to be shipped in two places,

1. Through Streaming Replication
2. By the process_command

This redundant shipping of the same information is expensive and consumes
network bandwidth. This can be avoided with the use of archive_mode=always.

archive_mode=always makes the standby archive the WAL logs it receives,
thus avoiding the requirement of having to ship it separately.

Thank you,
Narayanan

On Mon, Oct 22, 2018 at 2:36 PM Adelino Silva <
adelino(dot)j(dot)silva(at)googlemail(dot)com> wrote:

> Hello Takayuki,
>
> Sorry can you explain how we can same network bandwidth by not sending the
> WAL archive from the primary to the standby(s).
> I possible scenario is have to multiple standby servers in same host for
> same master. or other scenarios exists ?
>
> Many thanks in advance,
> Adelino.
>
>
> On Mon, Oct 22, 2018 at 1:47 AM Tsunakawa, Takayuki <
> tsunakawa(dot)takay(at)jp(dot)fujitsu(dot)com> wrote:
>
>> From: Adelino Silva [mailto:adelino(dot)j(dot)silva(at)googlemail(dot)com]
>> > What is the advantage to use archive_mode = always in a slave server
>> compared
>> > to archive_mode = on (shared WAL archive) ?
>> >
>> > I only see duplication of Wal files, what is the purpose of this
>> feature ?
>>
>> This also saves you the network bandwidth by not sending the WAL archive
>> from the primary to the standby(s). The network bandwidth can be costly
>> between remote regions for disaster recovery.
>>
>>
>> Regards
>> Takayuki Tsunakawa
>>
>>
>>
>>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrey Borodin 2018-10-22 10:11:25 Re: [Patch] pg_rewind: options to use restore_command from recovery.conf or command line
Previous Message Laurenz Albe 2018-10-22 09:45:30 Re: Function to promote standby servers