Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gK8aE-0006s0-PP for pgsql-admin@arkaria.postgresql.org; Tue, 06 Nov 2018 21:08:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gK8aB-0002MK-Ss for pgsql-admin@arkaria.postgresql.org; Tue, 06 Nov 2018 21:08:19 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gK8aB-0002KV-5Y for pgsql-admin@lists.postgresql.org; Tue, 06 Nov 2018 21:08:19 +0000 Received: from truschnigg.info ([78.46.103.228]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gK8a3-0003pz-7T for pgsql-admin@postgresql.org; Tue, 06 Nov 2018 21:08:17 +0000 Received: from vault.lan (84-112-34-152.cable.dynamic.surfer.at [84.112.34.152]) (Authenticated sender: colo) by truschnigg.info (Postfix) with ESMTPSA id 99DEF40413; Tue, 6 Nov 2018 22:08:08 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=truschnigg.info; s=mail; t=1541538488; bh=NYBiTXefNdCL/szwjuluxvV7Yo2KxXcjCu/ZfttIwxI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=so73hxMv28VBw6Q8QJcdrUvhe8WZ2l7kh9AIhq6wyJVXvy2UA3zYqXpqFxwOqyEtG mPSdinNomvDYstO+rLh+K38cHYkyXoZsiHrv1O2Nol5ZV9qnMpWNhzlVDQbhzEmAg/ EaiUgHFK3kZyHJPd6OON4F+fmZJmaN86zHyejWkA= Date: Tue, 6 Nov 2018 22:08:06 +0100 From: Johannes Truschnigg To: Mark Steben Cc: pgsql-admin Subject: Re: Another streaming replication question Message-ID: <20181106210806.6dpnejjrzplwok34@vault.lan> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="skwao5mffabxqipt" Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --skwao5mffabxqipt Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Mark, On Tue, Nov 06, 2018 at 12:13:18PM -0500, Mark Steben wrote: > Good morning, >=20 > Thank you all for your responses to my questions about streaming/cascading > replication. I have them ironed out and running on three postgres 9.4 > sandbox servers. > My question is not 'how to ' but more 'best practices'. We currently have > hot standby non-streaming replication with one master serving two standbys > in parallel. We wish to convert > to streaming replication. My concern is that the logshipping load can be > quite high - up to 40 16MB logs per minute (during off-hours maintenance). We use streaming replication ("plain" TCP over a 10G Ethernet link) and have double-digit WAL segments per second at times - it's no problem for moderat= ely powerful, contemporary hardware. Using TLS would be fine, too, if you use a fast stream cipher. > In our current hot standby > environment the logs can queue up on the master side during this period - > eventually, during times of lower load they do catch up. So, a couple > questions: > 1. Can streaming replication work in this high-load situation? Sure (depending on your hardware/environment and your current load, of course). However, even if it doesn't, it won't make things worse in case you still archive WAL and/or set up a replication slot for your standby(s) - a second= ary will transparently switch back to applying WAL from the archive whenever streaming replication is interrupted (e.g. due to too much lag having accumulated, and too little WAL kept around on the master - in the absence = of replication slots, this can happen), and switch back to streaming once it h= as done so (and streaming is available). > 2. What, if anything, can I do to make it work better? Perhaps conve= rt > to cascade? Master -->standby1 ---> standby2 I guess it depends on what your (perceived?) bottleneck lies - is it your network's bandwith, your nodes' I/O capabilities, or maybe even mere CPU saturation that makes your setup work "not good enough" (you should qantify that, and think hard about how, and by how much, you want to improve)? The latter would be the hardest to solve (i.e. "get more powerful CPUs", or maybe "review your current CPUs' max. turbo frequency/power envelope"), whi= lst you could - if you were to upgrade to 9.5 or better - use WAL compression to potentially alleviate the former with a trivial config change. --=20 with best regards: - Johannes Truschnigg ( johannes@truschnigg.info ) www: https://johannes.truschnigg.info/ phone: +43 650 2 133337 xmpp: johannes@truschnigg.info Please do not bother me with HTML-email or attachments. Thank you. --skwao5mffabxqipt Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEGu9IhkI+7/aKLUWF95W3jMsYfLUFAlviArMACgkQ95W3jMsY fLUzWRAAvpspQ7ZCEA2tgmboMV74hSbQO6WbwtkUN1rNcBheAdbqELc4i/8ExvEP phS377Iy8lQLFntfq48Maz74djNROvaK+ng0kaaC2LzB7jEouN/51rRmdwpM1WCn EIAp3LKNNkIbJXDLP8WAasdSyao8/SlAkqn6emuGM/SQvtN8Jjv78FAoyheqKwiS nQComuhomjZqnCVZhEBpb/mY7fhV/fa2tCpSCXSUoaWIcUSry1jUyBAbZkieI7qI hE+xspl3HOc8fD8Hk77kZ3VSuyftPhjIKmSuUb1kUDvFeFdVB938wf4gzN1F7Hak j94Go1XdD9Pc2gUhLFjcpNkdUv6NK5KajjGyPtQywiJSI4yXqEtbDMfNfgzvgbHS 3wwwiWFRvbnBkcrHtBW3RJRZdCk7wKQB8b9I2HEUW9fWE706qgN8Lv3o/YdgLX7N cRTK8167RkN4/Etb9gdr3xBIpTz0E+TdNpVMrWLfZiPeAzmQZ9p6DbrqDCsG9wBR YCJJi0dbn/QynGTXp95V5RWbf17VxoqiKjkx7BxBo7JYcvz+jhCsx4CwkJLh7qCy xxfEkFB+Ebj2qwAvDc5j1CNhXxJYGichDyoNhX3EvhMV7HO7X/NgWBORtgfjJrwk Yq9wt9bbhI38i3vf9uvpZk8ryVFGPPl6Hob0cVi6ajagvkro+hE= =FkM8 -----END PGP SIGNATURE----- --skwao5mffabxqipt--