Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lbtYI-0007nS-3t for pgsql-hackers@arkaria.postgresql.org; Wed, 28 Apr 2021 23:25:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lbtYF-0004d5-UX for pgsql-hackers@arkaria.postgresql.org; Wed, 28 Apr 2021 23:25:03 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lbtYF-0004cy-My for pgsql-hackers@lists.postgresql.org; Wed, 28 Apr 2021 23:25:03 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lbtYD-0003Mm-Fm for pgsql-hackers@postgresql.org; Wed, 28 Apr 2021 23:25:02 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 13SNOrik2947530; Wed, 28 Apr 2021 19:24:53 -0400 From: Tom Lane To: Thomas Munro cc: Andres Freund , Stephen Frost , Alvaro Herrera , David Steele , Dmitry Dolgov <9erthalion6@gmail.com>, Jakub Wartak , Tomas Vondra , pgsql-hackers Subject: Re: WIP: WAL prefetch (another approach) In-reply-to: References: <8dd2dcc2-0b6b-a4ab-c1b3-032c0a5ab1c3@enterprisedb.com> <773932.1619022622@sss.pgh.pa.us> <892344.1619054465@sss.pgh.pa.us> <20210428163245.ff67pb2ii5irr5zr@alap3.anarazel.de> <2808045.1619628335@sss.pgh.pa.us> Comments: In-reply-to Thomas Munro message dated "Thu, 29 Apr 2021 10:46:14 +1200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2947528.1619652293.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 28 Apr 2021 19:24:53 -0400 Message-ID: <2947529.1619652293@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Thomas Munro writes: > FWIW I also chewed through many megawatts trying to reproduce this on > a PowerPC system in 64 bit big endian mode, with an emulator. No > cigar. However, it's so slow that I didn't make it to 10 runs... Speaking of megawatts ... my G4 has now finished about ten cycles of installcheck-parallel without a failure, which isn't really enough to draw any conclusions yet. But I happened to notice the accumulated CPU time for the background processes: USER PID %CPU %MEM VSZ RSS TT STAT STARTED TIME COM= MAND tgl 19048 0.0 4.4 229952 92196 ?? Ss 3:19PM 19:59.19 pos= tgres: startup recovering 000000010000001400000022 = tgl 19051 0.0 0.1 229656 1696 ?? Ss 3:19PM 27:09.14 pos= tgres: walreceiver streaming 14/227D8F14 = tgl 19052 0.0 0.1 229904 2516 ?? Ss 3:19PM 17:38.17 pos= tgres: walsender tgl [local] streaming 14/227D8F14 = IOW, we've spent over twice as many CPU cycles shipping data to the standby as we did in applying the WAL on the standby. Is this expected? I've got wal_consistency_checking =3D all, which is bloating the WAL volume quite a bit, but still it seems like the walsender and walreceiver have little excuse for spending more cycles per byte than the startup process. (This is testing b3ee4c503, so if Thomas' WAL changes improved efficiency of the replay process at all, the discrepancy could be even worse in HEAD.) regards, tom lane