Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gf9t8-0000XG-W8 for pgsql-general@arkaria.postgresql.org; Thu, 03 Jan 2019 20:46:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gf9t7-0007rG-Jh for pgsql-general@arkaria.postgresql.org; Thu, 03 Jan 2019 20:46:45 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gf9t7-0007r8-BP for pgsql-general@lists.postgresql.org; Thu, 03 Jan 2019 20:46:45 +0000 Received: from tamriel.snowman.net ([96.255.250.162]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gf9t0-0006ZQ-Ie for pgsql-general@postgresql.org; Thu, 03 Jan 2019 20:46:44 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id 1F6A05F79E; Thu, 3 Jan 2019 15:46:37 -0500 (EST) Date: Thu, 3 Jan 2019 15:46:37 -0500 From: Stephen Frost To: Chuck Martin Cc: Jeff Janes , pgsql-general Subject: Re: getting pg_basebackup to use remote destination Message-ID: <20190103204636.GV2528@tamriel.snowman.net> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="2Stxnv0JS2q2nyCF" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --2Stxnv0JS2q2nyCF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 --2Stxnv0JS2q2nyCF Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJcLnSsAAoJEO1sijiDR2RVmDMQALWlF0ySWHhxLkp91fljXOht fN15WYNiNRPS2QefSed29sthTp8AAJe0Hal5k/ZVRaVEphPRa46maayttZNYiRrw EAohHf0sOR+SpwDcmkRXQbC2m2hbU6OlxT9OhN+4vp6TY7FyZiSXhlZwgERvCLsZ 0xiXLnTHKDW9FfnT2ZeALbAJT5acZLyGNDjw1kMHrKFr7tTtt53ioxUBemUtCY8Y A60QEsDO1o3AdIe0EuSvPmT2XzkHfFy80UDMrrSBh0S9ZYNrOhvzSmBRGUG+UHdZ u5EaApmCYX/MvBYiuxXu1PUPzk6Ed6EXR+uIcu093O0gpFw+Sy0/g35rtVtkxssM 7M+mP47X3+gnin3hXp4COZEI/wslDXQxbcH1dcYjCLhkZgjPIwTo6kN+Z7g7qMoS JCRzJOpyOg+Q2M1rMwpICn0s8kbfDU63FHnR0nrMl2xU/w38twQR8nV4Uz2sZAzI LkmrNLPZDZHyd+PiUPzftoW8z2sTDJh7FKUjteDDcOHUd3SrVyxql9Dt8UIpymsS /ipfKkk0tHupIyi8wyRBEGeOQn/K9zpKlqgjgvht4GgJBI/y3vWcSN8Zw1Byu1QL rJ36uJhW3PofJQ8BvxiurGU50T823SzEJEbdEwOKsm14Ee6yh5ZMlKEK6OZ7Dv6t ds4DDNNWwn0z6QVPEfGL =8lNn -----END PGP SIGNATURE----- --2Stxnv0JS2q2nyCF--