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 1kGdPl-0000tc-It for pgsql-hackers@arkaria.postgresql.org; Fri, 11 Sep 2020 07:24:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kGdPF-0000oN-4T for pgsql-hackers@arkaria.postgresql.org; Fri, 11 Sep 2020 07:23:37 +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 1kGdPE-0000nP-QX for pgsql-hackers@lists.postgresql.org; Fri, 11 Sep 2020 07:23:36 +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 1kGdP9-0000FW-Hx for pgsql-hackers@postgresql.org; Fri, 11 Sep 2020 07:23:35 +0000 Received: from oss.nttdata.com (localhost [127.0.0.1]) by oss.nttdata.com (Postfix) with ESMTP id 50F0A6151A; Fri, 11 Sep 2020 16:23: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=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Fri, 11 Sep 2020 16:23:28 +0900 From: bttanakahbk To: Fujii Masao Cc: Hamid Akhtar , Pavel Stehule , Peter Geoghegan , Julien Rouhaud , "Tharakan, Robins" , pgsql-hackers@postgresql.org Subject: Re: track_planning causing performance regression In-Reply-To: References: <2895b53b033c47ccb22972b589050dd9@EX13D05UWC001.ant.amazon.com> <42a13b4c-e60c-c6e7-3475-8eff8050bed4@oss.nttdata.com> <646e5cae-5e8b-feaa-43dc-014bf355bf08@oss.nttdata.com> <73b66e99-b4f3-9c4e-3b70-157ddbe81771@oss.nttdata.com> <773565c1-6508-063a-8872-20c16d283ee8@oss.nttdata.com> <94a5cda2-b814-d4a8-59d3-b5f00f889e71@oss.nttdata.com> Message-ID: X-Sender: bttanakahbk@oss.nttdata.com User-Agent: Roundcube Webmail/1.1.9 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi, On 2020-08-19 00:43, Fujii Masao wrote: >> Yes, I pushed the document_overhead_by_track_planning.patch, but this >> CF entry is for pgss_lwlock_v1.patch which replaces spinlocks with >> lwlocks >> in pg_stat_statements. The latter patch has not been committed yet. >> Probably attachding the different patches in the same thread would >> cause >> this confusing thing... Anyway, thanks for your comment! > > To avoid further confusion, I attached the rebased version of > the patch that was registered at CF. I'd appreciate it if > you review this version. I tested pgss_lwlock_v2.patch with 3 workloads. And I couldn't observe performance improvement in our environment and I'm afraid to say that even worser in some case. - Workload1: pgbench select-only mode - Workload2: pgbench custom scripts which run "SELECT 1;" - Workload3: pgbench custom scripts which run 1000 types of different simple queries - Workload1 First we set the pg_stat_statements.track_planning to on/off and run the fully-cached pgbench select-only mode on pg14head which is installed in on-premises server(32CPU, 256GB mem). However in this enveronment we couldn't reproduce 45% performance drop due to s_lock conflict (Tharakan-san mentioned in his post on 2895b53b033c47ccb22972b589050dd9@EX13D05UWC001.ant.amazon.com). - Workload2 Then we adopted pgbench custom script "SELECT 1;" which supposed to increase the s_lock and make it easier to reproduce the issue. In this case around 10% of performance decrease which also shows slightly increase in s_lock (~10%). With this senario, despite a s_lock absence, the patch shows more than 50% performance degradation regardless of track_planning. And also we couldn't see performance improvement in this workload. pgbench: initialization: pgbench -i -s 100 benchmarking : pgbench -j16 -c128 -T180 -r -n -f