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 1iY3Lw-0002LY-VK for pgsql-hackers@arkaria.postgresql.org; Fri, 22 Nov 2019 07:27:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iY3Lv-0004Zg-Pv for pgsql-hackers@arkaria.postgresql.org; Fri, 22 Nov 2019 07:27:39 +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 1iY3Lv-0004GN-4Z for pgsql-hackers@lists.postgresql.org; Fri, 22 Nov 2019 07:27:39 +0000 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1iY3Lq-0003jf-V6 for pgsql-hackers@postgresql.org; Fri, 22 Nov 2019 07:27:37 +0000 Received: by mail-wr1-x441.google.com with SMTP id t2so7397024wrr.1 for ; Thu, 21 Nov 2019 23:27:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:in-reply-to:references:comments:mime-version :content-id:content-transfer-encoding:date:message-id; bh=WGVdvoCPGV00PL8D3seyTgVZPLRt0L6sABcxxmeqdqQ=; b=QzNMW+CyYJ5Ce2zcWcs17OZZASHqmw8TJ4RVtzNJvpAlaM0T/SCFgU4+6Ha/GmrdDO hpz3DJ18P9tXZoyC8WVhmn8ALJ01wxs8HWtMdxantPcWF5M3m0vW9+LJ6tLs/ABRyGSs 3TO6l1oO8kV9u5X5S8xxv+mzCBT9V91UKmACSVyr5jl4RNo+b8ZTVcUgjwMx8U42L9MW Pa9NEsNi70UxOw21AkEhirj4VupLy8/fKxWfZHrga/gKib5pHCajWmtK6CtgEKZgirZv McD0+C8piL5qCRsIeJZDMbMmOQQ7xSHtcWAQomenTNzAsq4QimGs4mARRauSS74U0Hza 6Zcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references :comments:mime-version:content-id:content-transfer-encoding:date :message-id; bh=WGVdvoCPGV00PL8D3seyTgVZPLRt0L6sABcxxmeqdqQ=; b=rkg0xu2ryC32d+mpgI0XfKaaagDbJkV7hSgPO0DlhfxGFnjV5MLrGx9kZDXtIN+lbO dJXrft5iflMQyTcLlsQjF9XRp0JdolEA7YLbuRC3gbSoGkVh/9QCiD00gBn+cP5R1Kv6 Kc4uns93gssioEUCkW9mE5OWRCpODX9pih0pa7yAuzEAlE5ZLjSKhJ8teGa1DOXiMqcZ aGKP/fHyOVEdqKLYs55+Zhxe5fkvX6QUXcCvokRUg1nck8FRiJf3/uuOH+IBCRK6Ta6b fvjrGwboMOem7nvDKiauDYXjXoGRJopnqVyFIRDCe30ybnmIhMw4wWwp0QVBVZ43fY3P 1Fag== X-Gm-Message-State: APjAAAVmIO6B4dqDrJHItbCNFCpp37FwkCIPelYsZwjvOShlbWL9I3r1 0+83QdFz1X/Xu7zjzC+dkyH6HQ== X-Google-Smtp-Source: APXvYqxGVCh+WfJNocoV1CHcBBFwu8lG43RAuIstiM10X5CL3ArCqTC4jUO8HvhGjbTOFooPU/xirg== X-Received: by 2002:adf:f4c9:: with SMTP id h9mr15811209wrp.354.1574407653327; Thu, 21 Nov 2019 23:27:33 -0800 (PST) Received: from antos ([77.87.240.5]) by smtp.gmail.com with ESMTPSA id v6sm6678014wrt.13.2019.11.21.23.27.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Nov 2019 23:27:32 -0800 (PST) From: Antonin Houska To: Michael Paquier cc: Alvaro Herrera , Thomas Munro , Robert Haas , "pgsql-hackers@postgresql.org" Subject: Re: Attempt to consolidate reading of XLOG page In-reply-to: <20191122004903.GB42684@paquier.xyz> References: <20191115214102.GA15616@alvherre.pgsql> <88183.1574261429@antos> <20191121080550.GG153437@paquier.xyz> <20191122004903.GB42684@paquier.xyz> Comments: In-reply-to Michael Paquier message dated "Fri, 22 Nov 2019 09:49:03 +0900." X-Mailer: MH-E 8.6+git; nmh 1.7; GNU Emacs 26.2.50 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <453.1574407712.1@antos> Content-Transfer-Encoding: quoted-printable Date: Fri, 22 Nov 2019 08:28:32 +0100 Message-ID: <454.1574407712@antos> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Michael Paquier wrote: > On Thu, Nov 21, 2019 at 05:05:50PM +0900, Michael Paquier wrote: > > And with WAL segments at 1MB, I was seeing quite a slowdown with the > > patch... Then I have done an extra test with pg_waldump with the > > segments generated previously with the output redirected to /dev/null. > > Going through 512 segments takes 15.730s with HEAD (average of 3 runs) > > and 15.851s with the patch. > = > Here are more tests with pg_waldump and 1MB/1GB segment sizes with > records generated from pgbench, (7 runs, eliminated the two highest > and two lowest, these are the remaining 3 runs as real time): > 1) 1MB segment size, 512 segments: > time pg_waldump 000000010000000100000C00 000000010000000100000F00 > /dev= /null > - HEAD: 0m4.512s, 0m4.446s, 0m4.501s > - Patch + system's pg_read: 0m4.495s, 0m4.502s, 0m4.486s > - Patch + fallback pg_read: 0m4.505s, 0m4.527s, 0m4.495s > 2) 1GB segment size, 3 segments: > time pg_waldump 000000010000000200000001 000000010000000200000003 > /dev= /null > - HEAD: 0m11.802s, 0m11.834s, 0m11.846s > - Patch + system's pg_read: 0m11.939s, 0m11.991s, 0m11.966s > - Patch + fallback pg_read: 0m12.054s, 0m12.066s, 0m12.159s > So there is a tendency for a small slowdown here. Still it is not > that much, so I withdraw my concerns. Thanks for the testing! I thought that in [1] you try discourage me from using pg_pread(), but now= it seems to be the opposite. Ideally I'd like to see no overhead added by my patch at all, but the code simplicity should matter too. As a clue, we can perhaps consider the fact that commit c24dcd0c removed explicit lseek() also from XLogWrite(), but I'm not sure how much we can compare XLOG writing and reading (I'd expect writing to be a bit less sequential than reading because XLogWrite() may need to write the last pag= e more than once.) Let's wait for Alvaro's judgement. > Another thing: > +void WALReadRaiseError(WALReadError *errinfo); > This is missing an "extern" declaration. I'll fix this as well as the other problem reported in [1] as soon as I kn= ow whether pg_pread() should be used or not. [1] https://www.postgresql.org/message-id/20191121080550.GG153437%40paquie= r.xyz -- = Antonin Houska Web: https://www.cybertec-postgresql.com