Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1treUr-006ncq-3K for pgsql-hackers@arkaria.postgresql.org; Mon, 10 Mar 2025 14:52:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1treUp-00DCUz-Ja for pgsql-hackers@arkaria.postgresql.org; Mon, 10 Mar 2025 14:52:47 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1treUp-00DCU4-90 for pgsql-hackers@lists.postgresql.org; Mon, 10 Mar 2025 14:52:47 +0000 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1treUn-0022nz-1t for pgsql-hackers@lists.postgresql.org; Mon, 10 Mar 2025 14:52:46 +0000 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-43ce71582e9so12073335e9.1 for ; Mon, 10 Mar 2025 07:52:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1741618364; x=1742223164; darn=lists.postgresql.org; h=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=4Tm/uVWvJJ5GCxXDwbXcMuvFcthM0QQAJgenU7zuItE=; b=TPhRZGFmx5H3EvfnXx+jE915fpeBYND4FqhK0q8nvXUvwV9UhOXloAKblLAVlUcgsa vAvAdlbJiYcSGiafTGzdUm/AggNdUBASVrCZgMFfURUXkDLovbMZPeuMLByvVd38gMXq w+8nlYv6iGDa4NL3+kPAkL1CpAq7VUoaSPwbAm7dEH/DtoxEV0/G6gjtTD2h7Ku4BJ77 rvwdpzWBQM7n3CnlnLI8VCjrZrZ/k8PIKYfMxyONzRv1EmrsQr/2633l1IxzPeT+bHdM QQJAIc6eLgZU8XyyljrsSwaKTZvyDtKhe+CgXarVmaye6By8y7txyhdxhUmXFjytc1d1 WGsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741618364; x=1742223164; h=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=4Tm/uVWvJJ5GCxXDwbXcMuvFcthM0QQAJgenU7zuItE=; b=bmOBemyPm4Mg1gCKo5os2F4avh+GdwamFmT4b9rLrVJXWdEmizYjCJZZ0fZiXjdwju dBYb3y2JsdlDcGpmqxhj/zmALV6v97KO2cCZn0ff7KNZnejUjr7WB5zKvOju0bNwk+mk 0kAgpm5IxBqHx28eo44+goAHaIowS9kP/2/SeKYdxYOFYrsZjo/otfnXMzac1m00HUDi iMpi7t25U7Cg16urcG5SI3tgA/RKEI7OtSEVRcH5BlAJyDFdeNrVK+6RJccceTajSpQP 0nmY3ZCNKhjY7PnGjMohDYYJaiJNt5h2YJR8SlxvgsPqqzhULyy0v9mzKTJrpZh1DZQe QI2Q== X-Gm-Message-State: AOJu0YzevAiTNl+XBRNebFVu7NAztXeFXEeDnihl1b9z7hMLnNlX1sEP +MPpswOrf1GA/xuQfd2bDKB6urA79HB9fuUu8CTd+WnAJzdY+/hwAxvjzA== X-Gm-Gg: ASbGncvqS5EbsHylhkYSnGRW0PPZvV2ifFii/RheUzdvjV0O28R8/QcPVC1oiGwMjeb dfCb6dbJl9GkWN8SNyTPGVLgiK5dxkTA2L5HOZtX6IoRobgMKZlKLbj9oa2xYzNyljC/wqEBCvC NEabeVNgTAsSPA1kQJ3PM7UHR5cZ+0qwXQheaTsDwjb8P9obecyVqzkSLxzEO2wbwNSto+dmDQA nLsAs36Jgyu8I+XtK+17gTfckiCqMAgB97IHNUP867RiruXWBTSahzy5NHZOQRg2wq7d9Jdb63C Acp20O6HC4HlVI2nuWrK1vu9C/WtPo8BYwQ2DXzhTW5UcEjFXNxMEvOgqr8bl4UC2YUGyKI2wSW eH76+vcobSH05E6zL2BQpYJzaosPQz87ePPw+E8pNkKsIG8vElpMn/XtVCcCWv/roJYNfrHXpdf H5 X-Google-Smtp-Source: AGHT+IE5QfspP5FMrEjshadDXKFrKxKfnEiDh+QndNZJNILcyToLNr774vdEAqzn1Me1iJ0hKzxETA== X-Received: by 2002:a05:600c:4e8d:b0:43b:c0fa:f9e4 with SMTP id 5b1f17b1804b1-43c5a60ed2emr96057745e9.13.1741618363872; Mon, 10 Mar 2025 07:52:43 -0700 (PDT) Received: from ip-10-97-1-34.eu-west-3.compute.internal (ec2-15-237-181-182.eu-west-3.compute.amazonaws.com. [15.237.181.182]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43ce9f2d081sm84278615e9.21.2025.03.10.07.52.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Mar 2025 07:52:43 -0700 (PDT) Date: Mon, 10 Mar 2025 14:52:42 +0000 From: Bertrand Drouvot To: Michael Paquier Cc: pgsql-hackers@lists.postgresql.org Subject: Re: [BUG]: the walsender does not update its IO statistics until it exits Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On Mon, Mar 10, 2025 at 09:23:50AM +0900, Michael Paquier wrote: > On Mon, Mar 03, 2025 at 11:54:39AM +0000, Bertrand Drouvot wrote: > > So it does not look like what we're adding here can be seen as a primary bottleneck > > but that is probably worth implementing the "have_iostats" optimization attached. > > > > Also, while I did not measure any noticeable extra lag, given the fact that > > pgstat_flush_io() shows at about 5.5% and pgstat_flush_backend() at about 2.5%, > > that could still make sense to reduce the frequency of the flush calls, thoughts? > > - I've spotted a third candidate which looks pretty solid, actually: > WalSndWaitForWal() before WalSndWait(). This leads to 2.9k reports in > the whole test suite, with much less contention in the reports. These > can still be rather frequent, up to ~50 calls per seconds, but that's > really less than the two others. > > Stats data is useful as long as it is possible to get an idea of how > the system behaves, particularly with a steady workload. More > frequent reports are useful for spikey data detection, showing more > noise. Still, too many reports may cause the part gathering the > reports to become a bottleneck, while we want it to offer hints about > bottlenecks. So I would argue in favor of a more conservative choice > in the back branches than what the patch is proposing. Yeah, fully agree. Anyway, having so many frequent stats reports makes little sense. > Choice 3 i'm > quoting above is tempting by design: not too much, still frequent > enough to offer enough relevant information in the stats. Yeah, I also agree that we should reduce the number of "reports". I'll look at the third option. Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com