Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eaOZg-0000YZ-1Q for pgsql-general@arkaria.postgresql.org; Sat, 13 Jan 2018 16:22:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eaOZd-0006WF-Tw for pgsql-general@arkaria.postgresql.org; Sat, 13 Jan 2018 16:22:25 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eaOZd-0006W0-JL for pgsql-general@lists.postgresql.org; Sat, 13 Jan 2018 16:22:25 +0000 Received: from tamriel.snowman.net ([2001:470:e38f::11]) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1eaOZa-0004f2-RF for pgsql-general@lists.postgresql.org; Sat, 13 Jan 2018 16:22:24 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id A613F5F7A2; Sat, 13 Jan 2018 11:22:21 -0500 (EST) Date: Sat, 13 Jan 2018 11:22:21 -0500 From: Stephen Frost To: Raghavendra Rao J S V Cc: pgsql-general@lists.postgresql.org Subject: Re: pg_basebackup is taking more time than expected Message-ID: <20180113162221.GD2416@tamriel.snowman.net> References: <20180112130754.GF2416@tamriel.snowman.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="spO1RDoaRJPHb3vF" 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 --spO1RDoaRJPHb3vF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Greetings, Please don't top-post on the PG mailing lists. * Raghavendra Rao J S V (raghavendrajsv@gmail.com) wrote: > pg_basebackup utility depends on which are the parameters? I'm not sure what you're asking here. > Is there any possibility to run the pg_basebackup in multi thread? No, not today. There's been discussion about making it multi-threaded but I seriously doubt that'll happen for v11 at this point. > To improve the speed of the backup of database using pg_basebackup utility > we shutdown the database and started alone database services. Till that > time other sevices won't run. We observed some improvement but any other > things we need to perform to reduce the time taken by the pg_basebackup > utility. Sure, reducing the load of the system might make pg_basebackup a little faster, but seems unlikely to help it a lot in this case, and it means you have downtime which might not be ideal. > We are using below command to take the backup of the database. Any > improvements to reduce the time taken by backup statement. >=20 > $PGHOME/bin/pg_basebackup -p 5433 -U postgres -P -v -x --format=3Dtar --g= zip > --compress=3D6 --pgdata=3D- -D /opt/backup_db Might be faster if you didn't compress it, but, of course, then you wouldn't have a compressed backup. This is exactly the kind of issue that lead to the development of pgBackRest. Larger databases really do need multi-threaded backups and there weren't any backup tools for PG which were multi-threaded when we started. There's a few other options now, which is good, but pg_basebackup isn't one of them. Thanks! Stephen --spO1RDoaRJPHb3vF Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJaWjI9AAoJEO1sijiDR2RVSkMQALpT91WVDmY7RHeQLfWMdWDd 5ZWgGzhCIzj63DW9UVt/+YNzQ9Y/F70k6JSZkKSjxOKU2x4QlOmhkFCqXenUOtTV XEknZkTM/qdI4/upfSLEnaSXB4JnzwQX7BtUUvKuMLqUJ7jKpzxquSZNrqiKP0nZ sfItcoqX7/gNgzSP/un5mVp8/8fiC6wr+dPTOwwZaI6T/UhQ4LQxWdmgso0b2AUJ s8OdL2mbka4UU5DmIFVSty4Nb8Z4Gqcn898M1ZNsATj9f7HbgY2vlD4fwPgpY2WD pNdysVsV8AV9bQ/HgLc1IqXxHe98nZ/pZuF0G5zsXBtMtmVVRsLEFSGc58B4dW6a 0y1W8VHVjOF8tEmymQSr3mkWgNnh7hW8mXdUui8Ho9L/XnrKHbROJBSndAthHCUk q8t7aCWIFquZ0J/3P9uDoZgsN9juHZlxnxE5fHt93PUZPtFCpokdbIcONY8PacGR 7E7wfw4ip91pDbySRtSIC7D8v4uviqJSZgbjjaKE8TTQxXb8asRaBOpeII6MK6kV uXrMYMAdz8Ltlq3gTO10P5IPERQ+r42rGDTDcwTAVzC1GvhnirFUb1L/YIU2mRoX B7c2pXsuA+dQRsTRCIki47DFGfU7jow76Otf2KBN8+1Um7pFcKqrmW2+SE3M6pA/ JXnIq+EJ16ymrjwF+nYa =gfHL -----END PGP SIGNATURE----- --spO1RDoaRJPHb3vF--