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 1tsgqi-004gBv-BU for pgsql-hackers@arkaria.postgresql.org; Thu, 13 Mar 2025 11:35:40 +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 1tsgqh-00BQ5g-1a for pgsql-hackers@arkaria.postgresql.org; Thu, 13 Mar 2025 11:35:39 +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 1tsgqg-00BQ5Q-K5 for pgsql-hackers@lists.postgresql.org; Thu, 13 Mar 2025 11:35:38 +0000 Received: from mail-yw1-x1135.google.com ([2607:f8b0:4864:20::1135]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tsgqe-002bZ4-2a for pgsql-hackers@postgresql.org; Thu, 13 Mar 2025 11:35:37 +0000 Received: by mail-yw1-x1135.google.com with SMTP id 00721157ae682-6ff37565154so2744897b3.3 for ; Thu, 13 Mar 2025 04:35:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1741865736; x=1742470536; darn=postgresql.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=wGCoNUdaYXtujV+jULfmL9AoZfuo45OUvwiJrRR7vBw=; b=iilCxjrnvhDCgHUoasa0BNpq8jlduJ0ZFkoT7W5LbmWWs0yCSl1lXdNOYZdeY20Lub GnG3ZaePgBkOrFKfJNgrk8lAQ5OXKvRERh0YU9f0R42HPzl9JCaAZSu9QXxmlHueIQkO TR0zviEDVb64b/Wn4P9z61RkVnf3VpNCbgwKepGFiXirr1ytkurxykAK5LyoEd9zQPXa 2Sp3GOWzDIVv/CoSKi2cEN4qOeffO28NdhdlXVBYLLIZ1YPQ1vP+YQtLTL3FMkgSGgmk PEOz9/Yaxgn+48aTmOIjSLh6eJAyhyFkDpVFhv9FAOVYFVvnE4E2nTr2aI1kfh5LVsqv vb4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741865736; x=1742470536; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=wGCoNUdaYXtujV+jULfmL9AoZfuo45OUvwiJrRR7vBw=; b=GHi6qeC7I/EyVlgUZBmn2R/G+zMX4k3J0j3E1A521WNas+6sH0lovshFuxRt/vhepk DHSCMCXauAf6bu4OE6gaG0GStY8MSsiP6nNNvjCjqzuzaNehisZtwO6Lm6I71AC2e6nQ kOizzieTCLec+GKdU6JNqLGQ5EMrpnNp2NGKEoqYmPE1c8n15L6g/ztMNu021Ilug5b8 XI5KgUaUyTZGMzVFg0lelWhAWCy2IUw7rlJhj6msN5B4p+qvMxbnkT6mVL6c+uX8BLxt jNrE5l13cG7aKlznyU0WRK9CQjcscbIu+gZb7IqKvw0ivpZLOclEcnMFh3EaOU0jW2rq 1w2w== X-Gm-Message-State: AOJu0Yw+e/s2PCBw05sTDMmTuDVlIjo+vsGySw3nobZV/0wazAjiOlTd HF3rL3yqs2XzeS2O4Cy7QW0j5AbrtnF7XyzcYbTBc6daT6F349W7b27avLQUp1Tpg6imMS6b8Bo gsowcKMt8HAwyBmpLgVUeTtR/1iZtxq09aA0= X-Gm-Gg: ASbGncv2cfLm+e4sAH4UDYrBUk/8cioyWBIh0SPr53JLK0I79LUDwPgzxyAwrD53zY5 FHkQ/DRA7Low5Zwn/i7eVjEvA679E0Yb4jiuBXMGY350vjvKfy/cY5Moi8vFwhk4pvvoXZdCvPF xbfn+vTC28g9MVrhxgp7rf2A87 X-Google-Smtp-Source: AGHT+IF6H8TRxv7xxdKnBLDsBkvuLQj/oETeOOve7xu245vn7Y0fjtEgHU/rdOiSfldXdtDUvvOoXSx8boVDFuIZM4k= X-Received: by 2002:a05:690c:7207:b0:6f6:d405:7010 with SMTP id 00721157ae682-6febf39bb73mr351434817b3.29.1741865736054; Thu, 13 Mar 2025 04:35:36 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Xuneng Zhou Date: Thu, 13 Mar 2025 19:35:24 +0800 X-Gm-Features: AQ5f1JrECL63LClP3rm2TWonNd8kWiBK7G8-7VqFHHVhi8m826T8xQlVdKR1jjE Message-ID: Subject: Fwd: [BUG]: the walsender does not update its IO statistics until it exits To: PostgreSQL-development Content-Type: multipart/alternative; boundary="00000000000071b04b063037b863" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000071b04b063037b863 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sorry, forgot to cc this one too. ---------- Forwarded message --------- =E5=8F=91=E4=BB=B6=E4=BA=BA=EF=BC=9A Xuneng Zhou Date: 2025=E5=B9=B43=E6=9C=8813=E6=97=A5=E5=91=A8=E5=9B=9B 19:29 Subject: Re: [BUG]: the walsender does not update its IO statistics until it exits To: Bertrand Drouvot Hi, Given that PGSTAT_MIN_INTERVAL is the go-to setting for stats flushes * Unless called with 'force', pending stats updates are flushed happen onc= e * per PGSTAT_MIN_INTERVAL (1000ms). When not forced, stats flushes do not * block on lock acquisition, except if stats updates have been pending for * longer than PGSTAT_MAX_INTERVAL (60000ms). * * Whenever pending stats updates remain at the end of pgstat_report_stat() a * suggested idle timeout is returned. Currently this is always * PGSTAT_IDLE_INTERVAL (10000ms). Callers can use the returned time to set up * a timeout after which to call pgstat_report_stat(true), but are not * required to do so. I am curious about the reason for this: > 1. maybe relying on PGSTAT_IDLE_INTERVAL would make more sense? In both > case > PGSTAT_MIN_INTERVAL or PGSTAT_MIN_INTERVAL, I'm not sure there is a need = to > update the related doc. > > PGSTAT_IDLE_INTERVAL seems to reduce the frequency even more. > > With the attached in place, the number of times the stats are being flush= ed > reduce drastically but still seems enough to get an accurate idea of the > walsender > IO activity. Thoughts? > > > --00000000000071b04b063037b863 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Sorry, forgot to cc this one too.

-----= ----- Forwarded message ---------
=E5=8F=91=E4=BB=B6=E4=BA=BA=EF=BC=9A <= strong class=3D"gmail_sendername" dir=3D"auto">Xuneng Zhou <xunengzhou@gmail.co= m>
Date: 2025=E5=B9=B43=E6=9C=8813=E6=97=A5=E5=91=A8=E5=9B= =9B 19:29
Subject: Re: [BUG]: the walsender does not update its IO stati= stics until it exits
To: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>

Hi,
Given that PGSTA= T_MIN_INTERVAL is the go-to setting for stats flushes
=C2=A0* Unless cal= led with 'force', pending stats updates are flushed happen once
= =C2=A0* per PGSTAT_MIN_INTERVAL (1000ms). When not forced, stats flushes do= not
=C2=A0* block on lock acquisition, except if stats updates have bee= n pending for
=C2=A0* longer than PGSTAT_MAX_INTERVAL (60000ms).
=C2= =A0*
=C2=A0* Whenever pending stats updates remain at the end of pgstat_= report_stat() a
=C2=A0* suggested idle timeout is returned. Currently th= is is always
=C2=A0* PGSTAT_IDLE_INTERVAL (10000ms). Callers can use the= returned time to set up
=C2=A0* a timeout after which to call pgstat_re= port_stat(true), but are not
=C2=A0* required to do so.

=C2=A0I am curious about the reason for this:


= 1. maybe relying on PGSTAT_IDLE_INTERVAL would make more sense? In both cas= e
PGSTAT_MIN_INTERVAL or PGSTAT_MIN_INTERVAL, I'm not sure there is = a need to
update the related doc.


PGSTAT_IDLE_INTERVAL seems to reduce the frequency even more.
=

With the attached in place, the number of times the stats are being flushed=
reduce drastically but still seems enough to get an accurate idea of the wa= lsender
IO activity. Thoughts?


--00000000000071b04b063037b863--