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 1l2vKl-0005nu-Qb for pgsql-hackers@arkaria.postgresql.org; Fri, 22 Jan 2021 12:14: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 1l2vKk-0008KM-PK for pgsql-hackers@arkaria.postgresql.org; Fri, 22 Jan 2021 12:14:34 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l2vKk-0008KF-IZ for pgsql-hackers@lists.postgresql.org; Fri, 22 Jan 2021 12:14:34 +0000 Received: from oss.nttdata.com ([49.212.34.109]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l2vKh-0002Qw-Ql for pgsql-hackers@postgresql.org; Fri, 22 Jan 2021 12:14:33 +0000 Received: from oss.nttdata.com (localhost [127.0.0.1]) by oss.nttdata.com (Postfix) with ESMTP id BF4F962752; Fri, 22 Jan 2021 21:14: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: Fri, 22 Jan 2021 21:14:28 +0900 From: Masahiro Ikeda To: kuroda.hayato@fujitsu.com Cc: PostgreSQL-development Subject: RE: About to add WAL write/fsync statistics to pg_stat_wal view In-Reply-To: References: <0509ad67b585a5b86a83d445dfa75392@oss.nttdata.com> <65e99b78066ab1e3dc82a4e6f5e6f3cd@oss.nttdata.com> <7aef8ee6eea05a38ca91580caa5b2f07@oss.nttdata.com> Message-ID: <745b2bca8ea79d562d03f339ca193f9e@oss.nttdata.com> 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 2021-01-22 11:54, kuroda.hayato@fujitsu.com wrote: > Dear Ikeda-san, > > This patch cannot be applied to the HEAD, but anyway I put a comment. > > ``` > + /* > + * Measure i/o timing to fsync WAL data. > + * > + * The wal receiver skip to collect it to avoid performance > degradation of standy servers. > + * If sync_method doesn't have its fsync method, to skip too. > + */ > + if (!AmWalReceiverProcess() && track_wal_io_timing && > fsyncMethodCalled()) > + INSTR_TIME_SET_CURRENT(start); > ``` > > I think m_wal_sync_time should be collected even if the process is > WalRecevier. > Because all wal_fsync should be recorded, and > some performance issues have been aleady occurred if > track_wal_io_timing is turned on. > I think it's strange only to take care of the walrecevier case. Kuroda-san, Thanks for your comments. Although I thought that the performance impact may be bigger in standby servers because WALReceiver didn't use wal buffers, it's no need to be considered. I agreed that if track_wal_io_timing is turned on, the primary server's performance degradation occurs too. I will make rebased and modified. Regards, -- Masahiro Ikeda NTT DATA CORPORATION