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 1jUfhm-0002Gl-HS for pgsql-hackers@arkaria.postgresql.org; Sat, 02 May 2020 00:08:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jUfhj-0003gE-Nr for pgsql-hackers@arkaria.postgresql.org; Sat, 02 May 2020 00:08:27 +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 1jUfhj-0003g1-H5 for pgsql-hackers@lists.postgresql.org; Sat, 02 May 2020 00:08:27 +0000 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jUfhg-00026X-F2 for pgsql-hackers@postgresql.org; Sat, 02 May 2020 00:08:26 +0000 Received: by mail-wm1-x343.google.com with SMTP id x4so1714042wmj.1 for ; Fri, 01 May 2020 17:08:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=05sMILmrOnkAVDaOM1IZJTusESFBfY69V9hs2a7W8ZM=; b=IJX81XyCuJI81xw3iT+q1lQe9xQtd7GDKmHTIZlrOgvzYmzHGx8lqCdBnuBdHXJVNx 89Bpfq0qGVNcL0n6QVVOKm7Ea+thzQzcOrvvLJ9an8cToposOvKxRBc7+8vmh9GJBsuR VMj9CjnKXVHFoJdC06wlwtbukdMdvAtVR+8dWwVZ1Te0vMzXkgO2vsJzCqrrMB58W6tE PmIg1fdPU5ydC7CX7hvlqUg9s4S9lcLGzJv0y0VxG4uiJ8IXwbCZTLc5Mg4fvdTGwu5h lljEpEtXNKRKO7yJzHmc15M65LdFGPuvVAR74kJx3FIT2BW5nSM4BLIiTZ0nx5TGWCKW RTkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=05sMILmrOnkAVDaOM1IZJTusESFBfY69V9hs2a7W8ZM=; b=qBmhd+RRxufJpIauYauwWqCOw0pEtIozcuJeT0Nx/qBMsI9mRD9prMxNWUyWC6G+ZL paiNlEITuwKTTXU/HaITAUsSbyLFxakm8vIFaxyFUb3diqRWBeDDlP7kJivn8vyxRCig pOk+gfjKGR/8KKrEgINSdr8Y3rENYDBffnoSdxOlQQ3qABIEGUm8RTa98qeWlGaTkUo7 HhqnjQFe3C9nTWuQeAuj6RCIRWC+YS+GsQO8FRXkv3Ou4sAomDfgftqcVI1Zo91U3Ay8 a+9UErlALro67Q6Vzlb9vFq42prdinxHOBFOl5b2QqesoOacy8CQC+OBAQRWlNf2Zzm8 bCHA== X-Gm-Message-State: AGi0Pube3ByulNRTMU1/fwhWxtf9urrRMfA2j6yTYmsbSS8aUPUymOiT omoMjVqcLU2hQQj7/XyHJpFIAQ== X-Google-Smtp-Source: APiQypIRgpMKSt1HvMWufTSbt9XljxlQJAZfFCdvOXg81808yarNR6ECG3yCpezNORffCVi98hq2xw== X-Received: by 2002:a1c:b445:: with SMTP id d66mr1996331wmf.187.1588378102705; Fri, 01 May 2020 17:08:22 -0700 (PDT) Received: from localhost (ip-86-49-253-141.net.upcbroadband.cz. [86.49.253.141]) by smtp.gmail.com with ESMTPSA id z22sm1580878wma.20.2020.05.01.17.08.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 May 2020 17:08:21 -0700 (PDT) Date: Sat, 2 May 2020 02:08:18 +0200 From: Tomas Vondra To: Fujii Masao Cc: Alvaro Herrera , Masahiko Sawada , "tsunakawa.takay@fujitsu.com" , "pgsql-hackers@postgresql.org" Subject: Re: SLRU statistics Message-ID: <20200502000818.nn4kpewiput42bnb@development> References: <20200229122441.ow7gnnqgesmojyc3@development> <20200229144426.GA32500@alvherre.pgsql> <20200229205518.xrxo535zgd7cl6no@development> <20200327004111.md4suoi6u5suv2qe@development> <20200328002630.2nz5y3dvymqnvxtv@development> <20200402004136.wodwftan45mcwggm@development> <20200430181901.24tlriahmafi4sfn@development> <0e1c8904-13be-ab70-0096-54f0b30e43ba@oss.nttdata.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <0e1c8904-13be-ab70-0096-54f0b30e43ba@oss.nttdata.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Fri, May 01, 2020 at 11:49:51AM +0900, Fujii Masao wrote: > > >On 2020/05/01 3:19, Tomas Vondra wrote: >>On Fri, May 01, 2020 at 03:02:59AM +0900, Fujii Masao wrote: >>> >>> >>>On 2020/04/02 9:41, Tomas Vondra wrote: >>>>Hi, >>>> >>>>I've pushed this after some minor cleanup and improvements. >>> >>>+static char *slru_names[] = {"async", "clog", "commit_timestamp", >>>+                              "multixact_offset", "multixact_member", >>>+                              "oldserxid", "pg_xact", "subtrans", >>>+                              "other" /* has to be last */}; >>> >>>When I tried pg_stat_slru, I found that it returns a row for "pg_xact". >>>But since there is no "pg_xact" slru ("clog" slru exists instead), >>>"pg_xact" should be removed? Patch attached. >>> >> >>Yeah, I think I got confused and accidentally added both "clog" and >>"pg_xact". I'll get "pg_xact" removed. > >Thanks! > OK, pushed. Thanks! >Another thing I found is; pgstat_send_slru() should be called also by >other processes than backend? For example, since clog data is flushed >basically by checkpointer, checkpointer seems to need to send slru stats. >Otherwise, pg_stat_slru.flushes would not be updated. > Hmmm, that's a good point. If I understand the issue correctly, the checkpointer accumulates the stats but never really sends them because it never calls pgstat_report_stat/pgstat_send_slru. That's only called from PostgresMain, but not from CheckpointerMain. I think we could simply add pgstat_send_slru() right after the existing call in CheckpointerMain, right? regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services