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 1kelkr-0008Pa-Q4 for pgsql-hackers@arkaria.postgresql.org; Mon, 16 Nov 2020 21:09:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kelkq-0006Op-OX for pgsql-hackers@arkaria.postgresql.org; Mon, 16 Nov 2020 21:09:40 +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 1kelkq-0006Og-Fv for pgsql-hackers@lists.postgresql.org; Mon, 16 Nov 2020 21:09:40 +0000 Received: from mail.postgrespro.ru ([93.174.131.139]) by makus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kelkn-0006EL-NU for pgsql-hackers@postgresql.org; Mon, 16 Nov 2020 21:09:39 +0000 Received: from mail.postgrespro.ru (cyclops.postgrespro.ru [93.174.131.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mail.postgrespro.ru (Postfix) with ESMTPSA id 0782E21C3C98; Tue, 17 Nov 2020 00:09:35 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1605560975; bh=AKIUSd73SRRNwkJDaNvE8DYml0fzEa6fXgfBzX/e4fw=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=fM4HQGKYOtUAWNH+JHtnYdl/a5FYzOymeyKVBapifroMDFCCh2Y6hpRcu09m5yaMN 3DhChx4+vVwPg5Uify2qcKYOVLjiWY587ZsMxGvuH9tOwHS464mlvUAZG0+hTSXYfy F8ZsshCeA7eRGLui7k0GC+5jBRBBf8pDwB3tcejk= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 17 Nov 2020 00:09:34 +0300 From: Marina Polyakova To: Alexander Korotkov Cc: Andres Freund , pgsql-hackers Subject: Re: pgbench: option delaying queries till connections establishment? In-Reply-To: References: <20200227180100.zyvjwzcpiokfsqm2@alap3.anarazel.de> User-Agent: Roundcube Webmail/1.4.0 Message-ID: X-Sender: m.polyakova@postgrespro.ru Organization: Postgres Professional List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hello! On 2020-11-14 20:07, Alexander Korotkov wrote: > Hmm... Let's see the big picture. You've recently committed a > patchset, which greatly improved the performance of GetSnapshotData(). > And you're making further improvements in this direction. But you're > getting trouble in measuring the effect, because Postgres is still > stuck on ProcArrayLock. And in this thread you propose a workaround > for that implemented on the pgbench side. My very dumb idea is > following: should we finally give a chance to more fair lwlocks rather > than inventing workarounds? > > As I remember, your major argument against more fair lwlocks was the > idea that we should fix lwlocks use-cases rather than lwlock mechanism > themselves. But can we expect that we fix all the lwlocks use-case in > any reasonable prospect? My guess is 'no'. > > Links > 1. > https://www.postgresql.org/message-id/CAPpHfdvJhO1qutziOp%3Ddy8TO8Xb4L38BxgKG4RPa1up1Lzh_UQ%40mail.gmail.com Sorry I'm not familiar with the internal architecture of snapshots, locks etc. in postgres, but I wanted to ask - what exact kind of patch for fair lwlocks do you want to offer to the community? I applied the 6-th version of the patch for fair lwlocks from [1] to the old master branch (see commit [2]), started many threads in pgbench (-M prepared -c 1000 -j 500 -T 10 -P1 -S) and I did not receive stable first progress reports, which IIUC are one of the advantages of the discussed patch for the pgbench (see [3])... [1] https://www.postgresql.org/message-id/CAPpHfduV3v3EG7K74-9htBZz_mpE993zGz-%3D2k5RNA3tqabUAA%40mail.gmail.com [2] https://github.com/postgres/postgres/commit/84d514887f9ca673ae688d00f8b544e70f1ab270 [3] https://www.postgresql.org/message-id/20200227185129.hikscyenomnlrord%40alap3.anarazel.de -- Marina Polyakova Postgres Professional: http://www.postgrespro.com The Russian Postgres Company