pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephen Frost <sfrost@snowman.net>
To: Chuck Martin <clmartin@theombudsman.com>
Cc: Jeff Janes <jeff.janes@gmail.com>
Cc: pgsql-general <pgsql-general@postgresql.org>
Subject: Re: getting pg_basebackup to use remote destination
Date: Thu, 3 Jan 2019 15:46:37 -0500
Message-ID: <20190103204636.GV2528@tamriel.snowman.net> (raw)
In-Reply-To: <CAFw6=U35kx1PVsxo3oZboY8YdO327FX0hctL=eaqBvshK=2o6g@mail.gmail.com>
References: <CAFw6=U3TkX=qGEshwUS4iipx3E2SUcP5=G7L6v2AgBGywiOHnA@mail.gmail.com>
	<CAMkU=1y_+Epa9iyy9VpV1d6VtRv2zKr5Ub_S61Mcs523zpT_3g@mail.gmail.com>
	<CAFw6=U2oRHAjg4=OKtXOEARJB86R7k-j8k9KW8=q2yz0AGL6dA@mail.gmail.com>
	<CAMkU=1xNHs5hHapf1fNgJydeDOK-UqyXMR3Ho82E9KafbV+shQ@mail.gmail.com>
	<CAFw6=U35kx1PVsxo3oZboY8YdO327FX0hctL=eaqBvshK=2o6g@mail.gmail.com>

Greetings Chuck,

* Chuck Martin (clmartin@theombudsman.com) wrote:
> Using iperf, the transfer speed between the two servers (from the main to
> the standby) was 938 Mbits/sec. If I understand the units correctly, it is
> close to what it can be.

That does look like the rate it should be going at, but it should only
take about 2 hours to copy 750GB at that rate.

How much WAL does this system generate though...?  If you're generating
a very large amount then it's possible the WAL streaming is actually
clogging up the network and causing the rate of copy on the data files
to be quite slow.  You'd have to be generating quite a bit of WAL
though.

> Your earlier suggestion was to do the pg_basebackup locally and rsync it
> over. Maybe that would be faster. At this point, it is saying it is 6%
> through, over 24 hours after being started.

For building out a replica, I'd tend to use my backups anyway instead of
using pg_basebackup.  Provided you have good backups and reasonable WAL
retention, restoring a backup and then letting it replay WAL from the
archive until it can catch up with the primary works very well.  If you
have a very high rate of WAL then you might consider taking a full
backup and then taking an incremental backup (which is much faster, and
reduces the amount of WAL required to be only that needed for the length
of time that the incremental backup is started until the replica has
caught up to WAL that the primary has).

There's a few different backup tools out there which can do parallel
backup and in-transit compression, which loads up the primary's CPUs
with process doing compression but should reduce the overall time if the
bottleneck is the network.

Thanks!

Stephen

Attachments:

  signature.asc (application/pgp-signature, 818B) download

view thread (11+ messages)  latest in thread

Message-ID: <20190103204636.GV2528@tamriel.snowman.net>
Permalink:  ../20190103204636.GV2528@tamriel.snowman.net/
Also on:    postgresql.org/message-id/20190103204636.GV2528@tamriel.snowman.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: sfrost@snowman.net, clmartin@theombudsman.com, jeff.janes@gmail.com
  Subject: Re: getting pg_basebackup to use remote destination
  In-Reply-To: <20190103204636.GV2528@tamriel.snowman.net>
  References: <CAFw6=U3TkX=qGEshwUS4iipx3E2SUcP5=G7L6v2AgBGywiOHnA@mail.gmail.com> <CAMkU=1y_+Epa9iyy9VpV1d6VtRv2zKr5Ub_S61Mcs523zpT_3g@mail.gmail.com> <CAFw6=U2oRHAjg4=OKtXOEARJB86R7k-j8k9KW8=q2yz0AGL6dA@mail.gmail.com> <CAMkU=1xNHs5hHapf1fNgJydeDOK-UqyXMR3Ho82E9KafbV+shQ@mail.gmail.com> <CAFw6=U35kx1PVsxo3oZboY8YdO327FX0hctL=eaqBvshK=2o6g@mail.gmail.com> <20190103204636.GV2528@tamriel.snowman.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox