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 1tumK5-00BV5b-8v for pgsql-hackers@arkaria.postgresql.org; Wed, 19 Mar 2025 05:50:37 +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 1tumK3-00E8jD-Bt for pgsql-hackers@arkaria.postgresql.org; Wed, 19 Mar 2025 05:50:35 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tumK3-00E8j5-1q for pgsql-hackers@lists.postgresql.org; Wed, 19 Mar 2025 05:50:35 +0000 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tumJz-003hiD-11 for pgsql-hackers@postgresql.org; Wed, 19 Mar 2025 05:50:34 +0000 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-39133f709f5so3935960f8f.0 for ; Tue, 18 Mar 2025 22:50:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1742363430; x=1742968230; 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=rRoPVUY89+IVzoRrGP990DExRBdW1sq/JLCG7uR/yts=; b=iSqEqBwCIVxbUDWpcoULuTCPwX8zFnA8Q+6DXteDSycHDN73JTqNu+BNPVGHATKcC1 +TnOGJI8h77t2mK55FA3c4DRbdSyV1unC85htNfA6vz1mP3u3JG081nKNzO8jlrZk5JM Q9Tm6zPiSd7/3+xxjv/WeQPA43HI/II12lnnX5Ve9n9oLl167fM2hj5+MEN7VkQPUpIy tlr6J4jZh07qyNSVKV6Ny+bV68sidiaUbZonJvcHYgQFHhEXJ7Wct8njZIKOmx+llFUG KAB/fg5fzeFtXOxdPQQes4xlvkiB5JIEdE4blyfZPLmjeOZ4B0TdmdVAxIIxgWCBlCJU QVJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742363430; x=1742968230; 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=rRoPVUY89+IVzoRrGP990DExRBdW1sq/JLCG7uR/yts=; b=PySWplJlci3CokzgYSGaCIYIFPguobOfyQ+NHX6EEzbq45R4m+uoocA7TemHcLPRJ9 y0X1k5HDPqMTR0eKGd3hZILiflR/GM3FQBALIodLJuf2jVnm3D7YHd+b4j/8nve8luf5 1nA6kJBLbY60Rz3YrV8p2dvvRxqjviR1H2IDoXArduurPUo9RTY1Oux2XjddFYQTXbI5 XNPJy5qn3FfS7bkWg95FVCwa+dvVfbmG2JRnc2ig8iM1BRClmpFpcyxuhoB1t4AF8dOC O0IjXWox2bvIM/sm1OmsG/kRaSc400sre++Lackr4hYH00jpL/CB34aLv8U5ZQjQrPGJ KHXw== X-Forwarded-Encrypted: i=1; AJvYcCXjo3iaC8IS37L6nyZogaNNuFqMpGTfH7SgWo7vyfuJBQ1poSHhumsth2zkZuGgDxcrmghrpF8NqfeJoFz5@postgresql.org X-Gm-Message-State: AOJu0YyqrpIczUI6lCJOVhW13mtLDDwfiYo+eCZ9m0XBuU09W8uLVXTb q0bWx80bTk47MBsa71Ck5g2mPFXAZRkQXA4wlGtUdMkBLNTJmcQr X-Gm-Gg: ASbGnctMm+WzSpf/j4zqzbm/m2xbwtKTpfAnsvpK82qHx/gWpVeUlJ86mVk5+nhxHvJ 4s7eMSkN+UV3NBgdwTBIvZe3WiVO14ktUFcbBF0RqAHV77nD1brJD3jZ42D7Y/bYM//+5U3MbdL WP9uQ/BFsFz4Hmza+HEQsGVEJyVGbzke9SdmxZSlqCmfrwdjp9kwEAwjyOf9Ux7K92yz2yR7cNV tICY3ls395JQX//2jBWEpYvCOviBlmlqosOdZfdyop40Iyq5o6LQ29L2MPFMGxJS85djBFHB1aK JQ7Ibb52qjPmvuhNyqjvKT0x5pQSUHooPsjGdVZYaMep0156aicrLKYXqfUjofThy8uGmKP1H0C 78dTs1vXCGhINRtd/u5RrY8xYbLYLZfAd0coRX+z8uxHKNqzFAbvwDyLfvP6alg60LW/9GrsK1j 0R X-Google-Smtp-Source: AGHT+IFc4dRVS1liAjpvPbMMSfKVfrYm0js1BC/+DRYIkbU6vPFv16ZlJ8uGXd8Jz9/SXcvC04cpmA== X-Received: by 2002:a5d:5847:0:b0:38f:6697:af93 with SMTP id ffacd0b85a97d-399739b6121mr981836f8f.9.1742363429973; Tue, 18 Mar 2025 22:50:29 -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-395cb318a12sm19940024f8f.75.2025.03.18.22.50.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Mar 2025 22:50:29 -0700 (PDT) Date: Wed, 19 Mar 2025 05:50:28 +0000 From: Bertrand Drouvot To: Michael Paquier Cc: Xuneng Zhou , PostgreSQL-development , Andres Freund 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 Wed, Mar 19, 2025 at 02:26:47PM +0900, Michael Paquier wrote: > On Wed, Mar 19, 2025 at 09:53:16AM +0800, Xuneng Zhou wrote: > > I think these two conditions are good too. In a busy system, they are met > > frequently, so the flush routine will be executed at least once every > > second. Conversely, when WAL generation is low, there's simply less data to > > record, and the flush frequency naturally decreases. > > Hmm, yeah, perhaps this is acceptable. The changes in pgstat.c seem > inconsistent, though, only moving the min interval while the max and > idle times stay around. That's right. OTOH that sounds weird to move the others 2: that would create wider visibility for them without real needs. That's not a big issue, but could impact extensions or friends that would start using those should we change their values in the future. Another option could be to create a dedicated one in walsender.c but I'm not sure I like it more. > This also make me wonder if we should work towards extending > pgstat_report_stat(), so as we save in GetCurrentTimestamp() while > making the internals still local to pgstat.c. Or perhaps not in the > scope of a backpatchable design. I see. I think I'd vote for making the same changes on HEAD and the STABLE branches as a first step. And then think about a new "design" that could be part of the ideas suggested by Andres in [1]. Thoughts? Regards, [1]: https://www.postgresql.org/message-id/erpzwxoptqhuptdrtehqydzjapvroumkhh7lc6poclbhe7jk7l%40l3yfsq5q4pw7 -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com