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 1pGCX3-00048P-Tl for pgsql-hackers@arkaria.postgresql.org; Fri, 13 Jan 2023 05:23:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pGCX2-00077P-N0 for pgsql-hackers@arkaria.postgresql.org; Fri, 13 Jan 2023 05:23:12 +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 1pGCX2-00077D-5m for pgsql-hackers@lists.postgresql.org; Fri, 13 Jan 2023 05:23:12 +0000 Received: from mail-qt1-x835.google.com ([2607:f8b0:4864:20::835]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pGCWy-0000tE-VT for pgsql-hackers@postgresql.org; Fri, 13 Jan 2023 05:23:11 +0000 Received: by mail-qt1-x835.google.com with SMTP id bp44so18430034qtb.0 for ; Thu, 12 Jan 2023 21:23:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20210112.gappssmtp.com; s=20210112; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=+bA8eqOeD1ZiCTWwXPIcW4TcglO2nCDaCzFtp0AnQFs=; b=JukcIU32h9YeiiyczGGWPUthYfBDwe5WOHUeI2VTdilyetO3GKqabinuwboUbeTAgk vAjiKoJtXnFTWUVmIo1rud8xXeh1FCzIOgz+NoRhp1d+ppAqelslB6+x/4CDGQ+I2OZV Hnzj7mkBxWuwfppnSUqDI1G6ETrqZbsH81+FbtLyo2JjQRym+r9YD7An82HvZWZHXKrv RJN2USTSD4mmLIfOTReSVIV62Z/R3lf9et3GJId2kL+RjjbD0qJnvAzkMg1peEFgYrEH yJ184iGcj7i8TIdkWl1eWAzkbyOdq9PXq+6kM7K858I0izKTkZK1MjZnP3z4cqGrsJA7 6GdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+bA8eqOeD1ZiCTWwXPIcW4TcglO2nCDaCzFtp0AnQFs=; b=htMVpi5g5eMpa2VRyChuwNCVtHLOHdANUsy6CWrdVBYtfkjgIEH9bVYpS7+potqlgP wrC1SeTXE4dw6tkJj1l54dB11aAIMpRQBoLs64ZMDHEcZY6yRZUaHKNRF+D92xW1hlPe sxVlb4R+vUBmpRMYh0mKviCjqD6UuVNi5zJhT/CZUUhADiCILwpHEZw3eXJPfryu1Pek li/UX6TUx77H8Wg+/mZszGfsmY0TGe80o7TqELFuvehcvGsaCucgSVmNSN5vDTd+nVqo VKl65xkfndZ+e97H92NO2WZDr+iw+Zq3nWxcsO5Au7RQLCpkQDnTJ9UPD/+y0HNBoHXY pPqg== X-Gm-Message-State: AFqh2ko9o5Tlzf3k7J/IR7viDvQKq4fOfGdwHUGywCihh2kfDwEO2mw1 E+RcayoHdTyisNPnlcEOUqoozw== X-Google-Smtp-Source: AMrXdXv6hWaRX2EPUO/V/Sjwi1gMajdu4GzEcDhdPmOwmOS4s4cb1lGf18HHQGkFMsOt3DSOjrJ7MA== X-Received: by 2002:ac8:4d83:0:b0:3a5:2768:8b1c with SMTP id a3-20020ac84d83000000b003a527688b1cmr15381425qtw.11.1673587387900; Thu, 12 Jan 2023 21:23:07 -0800 (PST) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id jr49-20020a05622a803100b003ad373d04b6sm7152270qtb.59.2023.01.12.21.23.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Jan 2023 21:23:07 -0800 (PST) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id 0C3AC80104F; Thu, 12 Jan 2023 23:23:05 -0600 (CST) Date: Thu, 12 Jan 2023 23:23:05 -0600 From: Justin Pryzby To: Melanie Plageman Cc: Andres Freund , Lukas Fittl , Alvaro Herrera , Kyotaro Horiguchi , Magnus Hagander , pgsql-hackers@postgresql.org, Thomas Munro , Maciek Sakrejda , vignesh C Subject: Re: pg_stat_bgwriter.buffers_backend is pretty meaningless (and more?) Message-ID: <20230113052305.GW9837@telsasoft.com> References: <20221228235613.ep47flalmnkqgnu7@awork3.anarazel.de> <20230111215850.GO9837@telsasoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Jan 12, 2023 at 09:19:36PM -0500, Melanie Plageman wrote: > On Wed, Jan 11, 2023 at 4:58 PM Justin Pryzby wrote: > > > > > Subject: [PATCH v45 4/5] Add system view tracking IO ops per backend type > > > > The patch can/will fail with: > > > > CREATE TABLESPACE test_io_shared_stats_tblspc LOCATION ''; > > +WARNING: tablespaces created by regression test cases should have names starting with "regress_" > > > > CREATE TABLESPACE test_stats LOCATION ''; > > +WARNING: tablespaces created by regression test cases should have names starting with "regress_" > > > > (I already sent patches to address the omission in cirrus.yml) > > Thanks. I've fixed this > I make a tablespace in amcheck -- are there recommendations for naming > tablespaces in contrib also? That's the test_stats one I mentioned. Check with -DENFORCE_REGRESSION_TEST_NAME_RESTRICTIONS > > > + bulkread: Qualifying large read I/O operations > > > + done outside of shared buffers, for example, a sequential scan of a > > > + large table. > > > > I don't think it's correct to say that it's "outside of" shared-buffers. > > I suppose "outside of" gives the wrong idea. But I need to make clear > that this I/O is to and from buffers which are not a part of shared > buffers right now -- they may still be accessible from the same data > structures which access shared buffers but they are currently being used > in a different way. This would be a good place to link to a description of the ringbuffer, if we had one. > > s/Qualifying/Certain/ > > I feel like qualifying is more specific than certain, but I would be open > to changing it if there was a specific reason you don't like it. I suggested to change it because at first I started to interpret it as "The act of qualifying large I/O ops .." rather than "Large I/O ops that qualify..". + Number of read operations of op_bytes size. This is still a bit too easy to misinterpret as being in units of bytes. I suggest: Number of read operations (which are each of the size specified in >op_bytes<). + in order to add the shared buffer to a separate size-limited ring buffer separate comma + More information on configuring checkpointer can be found in Section 30.5. *the* checkpointer (as in the following paragraph) + backend_type checkpointer and + io_object temp relation. + I still think it's a bit hard to understand the s adjacent to s. + Some backend_types + in some io_contexts + on some io_objects + in certain io_contexts + on certain io_objects Maybe these should not use underscores: Some backend types never perform I/O operations in some I/O contexts and/or on some i/o objects. + for (BackendType bktype = B_INVALID; bktype < BACKEND_NUM_TYPES; bktype++) + for (IOContext io_context = IOCONTEXT_BULKREAD; io_context < IOCONTEXT_NUM_TYPES; io_context++) + for (IOObject io_obj = IOOBJECT_RELATION; io_obj < IOOBJECT_NUM_TYPES; io_obj++) + for (IOOp io_op = IOOP_EVICT; io_op < IOOP_NUM_TYPES; io_op++) These look a bit fragile due to starting at some hardcoded "first" value. In other places you use symbols "FIRST" symbols: + for (IOContext io_context = IOCONTEXT_FIRST; io_context < IOCONTEXT_NUM_TYPES; io_context++) + for (IOObject io_object = IOOBJECT_FIRST; io_object < IOOBJECT_NUM_TYPES; io_object++) + for (IOOp io_op = IOOP_FIRST; io_op < IOOP_NUM_TYPES; io_op++) I think that's marginally better, but I think having to define both FIRST and NUM is excessive and doesn't make it less fragile. Not sure what anyone else will say, but I'd prefer if it started at "0". Thanks for working on this - I'm looking forward to updating my rrdtool script for this soon. It'll be nice to finally distinguish huge number of "backend ringbuffer writes during ALTER" from other backend writes. Currently, that makes it look like something is terribly wrong. -- Justin