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 1kGjfY-0008OZ-3R for pgsql-hackers@arkaria.postgresql.org; Fri, 11 Sep 2020 14:04:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kGjfW-000357-VP for pgsql-hackers@arkaria.postgresql.org; Fri, 11 Sep 2020 14:04:50 +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 1kGjfW-000350-PJ for pgsql-hackers@lists.postgresql.org; Fri, 11 Sep 2020 14:04:50 +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 1kGjfT-0003hD-IQ for pgsql-hackers@postgresql.org; Fri, 11 Sep 2020 14:04:50 +0000 Received: from hnk.local (sp49-98-213-125.msd.spmode.ne.jp [49.98.213.125]) by oss.nttdata.com (Postfix) with ESMTPSA id F0DE86151A; Fri, 11 Sep 2020 23:04:41 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.102.3 at oss.nttdata.com Subject: Re: track_planning causing performance regression To: bttanakahbk Cc: Hamid Akhtar , Pavel Stehule , Peter Geoghegan , Julien Rouhaud , "Tharakan, Robins" , pgsql-hackers@postgresql.org 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> From: Fujii Masao Message-ID: Date: Fri, 11 Sep 2020 23:04:41 +0900 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2020/09/11 16:23, bttanakahbk wrote: > 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 Thanks for running the benchmarks! > > - 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