Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cW2Wq-0005qT-NV for pgsql-admin@arkaria.postgresql.org; Tue, 24 Jan 2017 14:57:00 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cW2Wq-0001Zg-Aa for pgsql-admin@arkaria.postgresql.org; Tue, 24 Jan 2017 14:57:00 +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_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cW2Wp-0001Za-Vi for pgsql-admin@postgresql.org; Tue, 24 Jan 2017 14:57:00 +0000 Received: from tamriel.snowman.net ([72.66.115.51]) by magus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cW2Wn-0002zx-0c for pgsql-admin@postgresql.org; Tue, 24 Jan 2017 14:56:59 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id 372665F796; Tue, 24 Jan 2017 09:55:56 -0500 (EST) Date: Tue, 24 Jan 2017 09:55:56 -0500 From: Stephen Frost To: Achilleas Mantzios Cc: pgsql-admin@postgresql.org Subject: Re: Strange times in WAL files in archive directory (9.3) Message-ID: <20170124145556.GR18360@tamriel.snowman.net> References: <58871A66.306@matrix.gatewaynet.com> <58873609.4030004@matrix.gatewaynet.com> <13126.1485264550@sss.pgh.pa.us> <588759C8.3090209@matrix.gatewaynet.com> <14804.1485267261@sss.pgh.pa.us> <588768FF.20906@matrix.gatewaynet.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="8zLhQ/8aZxqGwKat" Content-Disposition: inline In-Reply-To: <588768FF.20906@matrix.gatewaynet.com> X-Editor: Vim http://www.vim.org/ X-Info: http://www.snowman.net X-Operating-System: Linux/3.13.0-91-generic (x86_64) X-Uptime: 09:50:09 up 199 days, 16:14, 5 users, load average: 0.08, 0.07, 0.11 User-Agent: Mutt/1.5.21 (2010-09-15) X-Pg-Spam-Score: -5.1 (-----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org --8zLhQ/8aZxqGwKat Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Greetings, * Achilleas Mantzios (achill@matrix.gatewaynet.com) wrote: > I provided the archive_command in the 1st post. The copy is against anoth= er host (called sma in the command) : > archive_command =3D '/usr/bin/scp %p sma:/smadb/pgsql/pitr/%f' Note that this is not a recommended archive command- there is no guarantee that the copied WAL files are sync'd to disk on the 'sma' host and you could end up losing, potentially, a significant amount of your WAL on a failure. It's also, sadly, quite slow, with no way to be parallelized (PG will not start a new archive_command until the prior one completes, meaning that you could end up with a large backlog of un-archived WAL if the archive_command can't keep up, potentially leading to an out-of-space situation on your WAL filesystem, leading to a PANIC and crash).=20 There's also no compression with the proposed approach (in transit or at rest). Some of this is fixable with SSH (using ControlMaster, adding compression options, though that would only compress in transit, not on disk; if you wanted on-disk compression then you'd have to re-compress it again), but not all of it (you aren't going to get scp to fsync the WAL on the remote side, at least not by itself), but as noted by David already, using a third-party solution which has addressed all of these issues is really a better option than hand-rolling your own system. Thanks! Stephen --8zLhQ/8aZxqGwKat Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJYh2r7AAoJEO1sijiDR2RV6GAQAMQV1ebk4NX6sJqcMn/R9Q9M 9H13wQf5q+0VFfa3Ntfq4yHwMmTz6I0q2VtVIVDWsLvOrjW8Oid8HqPzMdumSdeu mGvYVbPSAJly8KUuGfUzBXxV9ESa40IEXVVQPGPyEKiu6kVbk0n80dUeKJRX1m1R e7yAcX2tVB4LtJYHXh+o6XDyce4nRf+lGDoWL09dQKOb629mRl/bTG1XwgKlQXhq k6epCityT+fHxso/uet0JvR1n2W79WoFjYLRBhI4UipGBvc/xxnWa5+5Cg/nGQ3x wsPvmnhoZnRVcrlQfMKIGDFBSqznLAd2nxWnCLeFQIYHr6T7CAwOeIKxgMAcKDeI NPIm9OAQMC/fvyI9ha9f/RyXy1MwRK06J+vZBvnvVUMf0PBTfj8I1rn0+/8B+jJj nNNzhClpFcmiTSJ4VQm53IHihuBLliHNqC7ZtkhQulEqUW+HG+2E1d4PncofCf8G ZmsjN4Z7Dpvfs6f4uRvuWPPLTdLjpZofxzFLZe60aNqngutf/vbQ5M80AYazBg6a ZDXzq5yqpqTx3az6cQUefcr4HA3SwxQXbPnPWDERzRYpN6PRQPv0gtzn0a9odDum VvSsqTQ50KPSh7l73YmHTgdsRrhc8dKl4+XITmRXjJYgPGSykFhFZJV42Dzu+68i 1JhsJ+/aPYjxE3+sms8J =7YYt -----END PGP SIGNATURE----- --8zLhQ/8aZxqGwKat--