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 1tsiTg-004xMJ-9a for pgsql-hackers@arkaria.postgresql.org; Thu, 13 Mar 2025 13:20:00 +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 1tsiTe-00Dd3I-Jm for pgsql-hackers@arkaria.postgresql.org; Thu, 13 Mar 2025 13:19:58 +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 1tsiTe-00Dd2I-9i for pgsql-hackers@lists.postgresql.org; Thu, 13 Mar 2025 13:19:58 +0000 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tsiTc-002cKe-1O for pgsql-hackers@postgresql.org; Thu, 13 Mar 2025 13:19:57 +0000 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-391342fc148so637567f8f.2 for ; Thu, 13 Mar 2025 06:19:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1741871995; x=1742476795; darn=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=6K+wTg6aw60J+UuGzj8T7ctnTitVfGL3vRHMXnfRvBc=; b=HKirIRUGGqhmZxR9rQxa9+bkYoQCtByB/uINF8Rapc3OAdKFpFculRUt41uJqpZCHb 1/NVFnGUhhOfR9e8HRCpoSgPU2ML2LMI5oNk3XSIfbb2B/CVmfAp5hh90/YMh8NbpnrA aph7MO7wcnXW4J2JFTdZg7eccRBS7qDPsTRZcZtBbGSMkh6CQuczfMDoWzwZJGAX/KmC R1/bhEeBstWXahh9kQ4CVvmlffMYeq4qJEeJZTWB8jVMuaMWPTbToopoU18nMmVoq5SV M3858PuQ3kek6oq7NZuwOVdkDhKVZZwQZ4hhC7UlGGsRJB6BT5yFa5nxILD5hje2P5Dc 7+dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741871995; x=1742476795; 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=6K+wTg6aw60J+UuGzj8T7ctnTitVfGL3vRHMXnfRvBc=; b=SBuSbEKUp3+JEegQ80LgvyXddPJhkYpKxXAnuS/Q/XfvxgHdJrUENMHjLpwARfUr6L YV1x+Mocq7MUBDslCC5D64n27SGbZnUe+toNjn6L/ZrAnyTiFXRwgANRmincPIprWJiO BLp/YYaKIYYD/iNdg37pb/3uFvaLum6OL0RL2PFWl6hNSyJSJixmgIWgii//oa/HTTBu o+fFWTHUjccwHO8ch+PIOTQ5Gt0DqFGqzQBkHSMomx3+J1X+Za6ASuHNi1TpN/7sAhWn g7AOTcvueeH6chLIexeR6hD0jaVIdM9q8hybT8GC85O/l3PW8hPm5RbITypKSw3B2LFH va9g== X-Gm-Message-State: AOJu0YzDgYO8ZFf7UMqBmWmEPqNHAl0o836pK2qdlQ1AtbNBh4ejAadO 8fEqwWGN91F7yeJWOQiuxMuAVrh+1PT8rWJvte+zC94ND1hsiD2X X-Gm-Gg: ASbGnctMNd3OHKHXXTCaZ82kle2j0UBz+sBhz10Kjyx8NBLyAS4GZWsY39ADEaE/odV e5ck/suNzkmzLjiKjar5zAz5QXCEgHR25lQroTAKLk7NR2UD/Bi+KyjzmevVqcmyS4scZtL1ZuU mQbzCANLh3V/GabjHUDOiNvE96aI9NCi5usDh4lQNSUE1grB+b0XhCWcuZXsRjetB/FcTkYnUZV FteEOm/Gq9SRwkpimtGaymD5XW5sbVDP919Le1NK9arRQ7vI6gEum6yXGC4wbQ46xNVK0fH8pBT yYWkT5C/0Ai1yB/WamMMRp1cuJoP/xnqkb9VdWxK2BL19COxyYKsl9/d3thxzVOcFF2ImKjiXY3 u4kHonpAQOmWgVFr1ZSBMBXqmmyXtndZS1i94N2PMzS8fIWZzAE0WBa1bhSj3wdg3ME84Iz6QZZ 7Y X-Google-Smtp-Source: AGHT+IE+3bDlOKDiHYVISccSPW2WAC5CVrskS3tzr+cduciGwHNSjPcqmPCxhexeGabHI2wMzZn4jg== X-Received: by 2002:a5d:584b:0:b0:391:4873:7940 with SMTP id ffacd0b85a97d-3926c78f6b5mr11295777f8f.54.1741871994686; Thu, 13 Mar 2025 06:19:54 -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 ffacd0b85a97d-395c4f9d59dsm2119361f8f.0.2025.03.13.06.19.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Mar 2025 06:19:53 -0700 (PDT) Date: Thu, 13 Mar 2025 13:19:51 +0000 From: Bertrand Drouvot To: Xuneng Zhou Cc: PostgreSQL-development Subject: Re: Fwd: [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 Thu, Mar 13, 2025 at 07:35:24PM +0800, Xuneng Zhou wrote: > Hi, > Given that PGSTAT_MIN_INTERVAL is the go-to setting for stats flushes > * Unless called with 'force', pending stats updates are flushed happen once > * 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: Thanks for looking at it! > > 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. Yeah, I think that PGSTAT_MIN_INTERVAL is the one to use (that's why that's the one the patch is using). I just mentioned PGSTAT_IDLE_INTERVAL as an open door for conversation in case one prefers a "larger" frequency. Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com