Re: Replication Delay

From: Jorge Torralba <jorge(dot)torralba(at)gmail(dot)com>
To: "Bedorf, Paul" <Paul(dot)Bedorf(at)mosaic(dot)com>
Cc: "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Replication Delay
Date: 2014-06-02 18:17:30
Message-ID: CACut7uQmp_cxD59HL6fJ7m8UCuTe9RoY-3Q7EX96dt1-nknHoQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

select now() - pg_last_xact_replay_timestamp() AS LAG_TIME;

archive_timeout (integer)

The archive_command <runtime-config-wal.html#GUC-ARCHIVE-COMMAND> is only
invoked for completed WAL segments. Hence, if your server generates little
WAL traffic (or has slack periods where it does so), there could be a long
delay between the completion of a transaction and its safe recording in
archive storage. To limit how old unarchived data can be, you can set
archive_timeout to force the server to switch to a new WAL segment file
periodically. When this parameter is greater than zero, the server will
switch to a new segment file whenever this many seconds have elapsed since
the last segment file switch, and there has been any database activity,
including a single checkpoint. (Increasing checkpoint_timeout will reduce
unnecessary checkpoints on an idle system.) Note that archived files that
are closed early due to a forced switch are still the same length as
completely full files. Therefore, it is unwise to use a very short
archive_timeout — it will bloat your archive storage. archive_timeout
settings of a minute or so are usually reasonable. This parameter can only
be set in the postgresql.conf file or on the server command line.

On Mon, Jun 2, 2014 at 11:01 AM, Bedorf, Paul <Paul(dot)Bedorf(at)mosaic(dot)com>
wrote:

> We have a primary and secondary postgresql server set up. Replication
> between the 2 works fine… just want to find if anyone knows what is the
> default replication delay time?
> or is there a way to view the replication time it takes from primary to
> the secondary server?
>
>
>
> Thanks
>
>
>
> __________________________________________________
>
> Paul Bedorf | Linux Administrator | Mosaic
> *O:* 905.238.8058 x 6414 | *M: *416.799.4028
> mosaic.com
>
>
>

--
Thanks,

Jorge Torralba
----------------------------

Note: This communication may contain privileged or other confidential
information. If you are not the intended recipient, please do not print,
copy, retransmit, disseminate or otherwise use the information. Please
indicate to the sender that you have received this email in error and
delete the copy you received. Thank You.

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Radovan Jablonovsky 2014-06-02 21:50:56 set search_path command
Previous Message Bedorf, Paul 2014-06-02 18:01:51 Replication Delay