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 1kVPUx-0008Vo-5D for pgsql-hackers@arkaria.postgresql.org; Thu, 22 Oct 2020 01:34:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kVPUw-0007gR-1t for pgsql-hackers@arkaria.postgresql.org; Thu, 22 Oct 2020 01:34:34 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kVPUv-0007gK-RV for pgsql-hackers@lists.postgresql.org; Thu, 22 Oct 2020 01:34:33 +0000 Received: from oss.nttdata.com ([49.212.34.109]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kVPUt-00046s-RI for pgsql-hackers@postgresql.org; Thu, 22 Oct 2020 01:34:33 +0000 Received: from oss.nttdata.com (localhost [127.0.0.1]) by oss.nttdata.com (Postfix) with ESMTP id D254A6033A; Thu, 22 Oct 2020 10:34:28 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.102.3 at oss.nttdata.com MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 22 Oct 2020 10:34:28 +0900 From: Masahiro Ikeda To: lchch1990@sina.cn Cc: Amit Kapila , pgsql-hackers Subject: Re: Add statistics to pg_stat_wal view for wal related parameter tuning In-Reply-To: <2020102114544806663477@sina.cn> References: <35ef960128b90bfae3b3fdf60a3a860f@oss.nttdata.com>, , <06bc2d405b086a72fb14657de9befae8@oss.nttdata.com> <2020102114544806663477@sina.cn> Message-ID: X-Sender: ikedamsh@oss.nttdata.com User-Agent: Roundcube Webmail/1.1.9 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2020-10-21 15:54, lchch1990@sina.cn wrote: > I think it's really a more convenient way to collect wal usage > information, > with it we can query when I want. Several points on my side: Thanks for your comments. > 1. It will be nice If you provide a chance to reset the information in > WalStats, > so that we can reset it without restart the database. I agree. Now, pg_stat_wal supports reset all informantion in WalStats using pg_stat_reset_shared('wal') function. Isn't it enough? > 2. I think 'wal_write_backend' is mean wal write times happen in > backends. The describe in document is not so clear, suggest rewrite > it. OK, I'll rewrite to "Total number of times backends write WAL data to the disk". > 3. I do not think it's a correct describe in document for > 'wal_buffers_full'. Where should I rewrite the description? If my understanding is not correct, please let me know. > 4. Quite strange to collect twice in XLogInsertRecord() for > xl_tot_len, > m_wal_records, m_wal_fpi. Yes, Amit-san pointed me that too. I'll remove them from pg_stat_wal since pg_stat_statements and vacuum log already shows the related statistics and there is a comment it's enough. Anyway, if you need to the accumulated above statistics in pg_stat_wal, please let me know. > 5. I notice some code in issue_xlog_fsync() function to collect sync > info, > a standby may call the issue_xlog_fsync() too, which do not want to > to collect this info. I think this need some change avoid run by > standby > side. Thanks, I will fix it. Regards, -- Masahiro Ikeda NTT DATA CORPORATION