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 1hboMx-00006m-3e for pgsql-general@arkaria.postgresql.org; Fri, 14 Jun 2019 15:43:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hboMw-0007zB-1R for pgsql-general@arkaria.postgresql.org; Fri, 14 Jun 2019 15:43:58 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hboMv-0007un-EN for pgsql-general@lists.postgresql.org; Fri, 14 Jun 2019 15:43:57 +0000 Received: from tamriel.snowman.net ([96.255.250.162]) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hboMo-00056O-Jg for pgsql-general@postgresql.org; Fri, 14 Jun 2019 15:43:55 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id 308775F7BE; Fri, 14 Jun 2019 11:43:50 -0400 (EDT) Date: Fri, 14 Jun 2019 11:43:50 -0400 From: Stephen Frost To: Tiemen Ruiten Cc: pgsql-general@postgresql.org Subject: Re: checkpoints taking much longer than expected Message-ID: <20190614154350.GE2480@tamriel.snowman.net> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="/RvYOEQaqo9O34Ko" 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 --/RvYOEQaqo9O34Ko Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Greetings, * Tiemen Ruiten (t.ruiten@tech-lab.io) wrote: > checkpoint_timeout =3D 60min That seems like a pretty long timeout. > My problem is that checkpoints are taking a long time. Even when I run a > few manual checkpoints one after the other, they keep taking very long, up > to 10 minutes: You haven't said *why* this is an issue... Why are you concerned with how long it takes to do a checkpoint? > 2019-06-14 15:21:10.351 CEST [23657] LOG: checkpoint starting: immediate > force wait > 2019-06-14 15:25:57.655 CEST [23657] LOG: checkpoint complete: wrote > 139831 buffers (13.3%); 0 WAL file(s) added, 148 removed, 40 recycled; > write=3D284.751 s, sync=3D0.532 s, total=3D287.304 s; sync files=3D537, > longest=3D0.010 s, average=3D0.000 s; distance=3D2745065 kB, estimate=3D2= 841407 kB > 2019-06-14 15:26:01.988 CEST [23657] LOG: checkpoint starting: immediate > force wait > 2019-06-14 15:30:30.430 CEST [23657] LOG: checkpoint complete: wrote > 238322 buffers (22.7%); 0 WAL file(s) added, 0 removed, 172 recycled; > write=3D264.794 s, sync=3D0.415 s, total=3D268.441 s; sync files=3D378, > longest=3D0.011 s, average=3D0.001 s; distance=3D2834018 kB, estimate=3D2= 840668 kB > 2019-06-14 15:30:44.097 CEST [23657] LOG: checkpoint starting: immediate > force wait > 2019-06-14 15:37:01.438 CEST [23657] LOG: checkpoint complete: wrote > 132286 buffers (12.6%); 0 WAL file(s) added, 54 removed, 96 recycled; > write=3D366.614 s, sync=3D2.975 s, total=3D377.341 s; sync files=3D467, > longest=3D0.095 s, average=3D0.006 s; distance=3D2444291 kB, estimate=3D2= 801030 kB >=20 > What is going on? It doesn't seem like normal behaviour? The time information is all there and it tells you what it's doing and how much had to be done... If you're unhappy with how long it takes to write out gigabytes of data and fsync hundreds of files, talk to your storage people... Thanks, Stephen --/RvYOEQaqo9O34Ko Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJdA8C1AAoJEO1sijiDR2RVc7kQALPTWiGwAkuxTD/WWMKPHTMT MBZSEvGOJ/NtFDBGHcYNgU0uLs4yJ95Nmf3iugTiIdd0+jOE9LRew7pOoUrjKzRD sSHMTwJtbV/W6X0T/vVKf7YcHwZiV9HJ5VQTvAKKeLyci0qq8CuerTOs5qUtXca2 CXD/DTFioRdkBeNQ02RwJQDzZALBnJyFBNG9uizcd+2dWnOq5TA9/NWMuxeafykA BP/hgwJxVPUrocb1f/jteKLGOwIAl6RYytPi3R/EDAo4HZxbUIKdN8hE9WtWO4V3 r38h1KgMm8+rieipwA9BdK1cmh/HTVI6bWsNibiypgF4810kvgc70YXzpthc/6Bg YLUbeVBTQ6FpyulPJmS+zYvk8YQVEJL7s2tQKNecE/lO7Pk3JBFCRjDcLaC5fzQO xUQwb9Jr/iJuHKId54+I21pspTr6V4z1G21idCJiUb7i0Q5iPFE0L4EyhBi2YiHl MTBU2ickUw0+F03wk4oTaQ8uIPI9CP0ztmsPBo3qnqpBYHcN1clVgcIIQvVi0X5a 2oqMFL2m4zx3ykUpKm3+pPaf8IgsJpAfvvfhGtP8GPOfmz0Vy42JxLUI90kkG+XA Mx8R+gj6ciuzYCdC/FREzWQvsbUVNUqGo8PLHMeGpalP4GFeWp+x46fxbdxnt4q6 cABPh2yoS8VDC6fSHGEz =Q4zU -----END PGP SIGNATURE----- --/RvYOEQaqo9O34Ko--