Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aqOhn-0000kz-1b for pgsql-committers@arkaria.postgresql.org; Wed, 13 Apr 2016 17:35:55 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1aqOhm-0006Ar-8q for pgsql-committers@arkaria.postgresql.org; Wed, 13 Apr 2016 17:35:54 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1aqOhl-00069J-EP for pgsql-committers@postgresql.org; Wed, 13 Apr 2016 17:35:53 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1aqOhe-0005H5-PG for pgsql-committers@postgresql.org; Wed, 13 Apr 2016 17:35:52 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 9C5DB21DB1 for ; Wed, 13 Apr 2016 13:35:45 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute2.internal (MEProxy); Wed, 13 Apr 2016 13:35:45 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=lmsXPPDJPizCZwelMXrGFlZiEJ4=; b=Y0JzU xibY9NUnfv17o8vGYHC3XZDhF5fApZcD8DJ6bkPqU8F6MWBdFDt2wbcRHgtN2MnR HsFqMGSuOMeGyjU/38ylVpkOiWPQFM9v7h1elV/NTgOJC4qiOqQr5H7OGMr86wja 0S4B812EARk4dquzCbXXGhUEXPgY7XbCFOStzQ= X-Sasl-enc: TupMBQsNMp9f/Ks0mfJxC/YwpwHMAFs/gJdDl83ictx7 1460568945 Received: from intern.anarazel.de (unknown [192.77.237.104]) by mail.messagingengine.com (Postfix) with ESMTPA id 34AE66800CE; Wed, 13 Apr 2016 13:35:45 -0400 (EDT) Date: Wed, 13 Apr 2016 10:35:44 -0700 From: Andres Freund To: Robert Haas Cc: Kevin Grittner , Kevin Grittner , "pgsql-hackers@postgresql.org" , "pgsql-committers@postgresql.org" Subject: Re: [HACKERS] Re: pgsql: Avoid extra locks in GetSnapshotData if old_snapshot_threshold < Message-ID: <20160413173544.wccprqbilckmoacb@alap3.anarazel.de> References: <20160412173856.6jumsz7es5zac42o@alap3.anarazel.de> <20160412185625.g7ixnlpwaqvsqt7v@alap3.anarazel.de> <20160412192801.wffn2vjyszyw4qa4@alap3.anarazel.de> <20160413171955.i53me46fqqhdlztq@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-committers Precedence: bulk Sender: pgsql-committers-owner@postgresql.org On 2016-04-13 13:25:14 -0400, Robert Haas wrote: > > With -c old_snapshot_threshold=0: > > > > latency average = 0.218 ms > > latency stddev = 0.154 ms > > tps = 584666.289753 (including connections establishing) > > tps = 584867.785569 (excluding connections establishing) > > > > > > With -c old_snapshot_threshold=10: > > > > latency average = 1.112 ms > > latency stddev = 1.246 ms > > tps = 114883.528964 (including connections establishing) > > tps = 114905.555943 (excluding connections establishing) > > > > > > With 848ef42bb8c7909c9d7baa38178d4a209906e7c1 (and followups) reverted: > > latency average = 0.210 ms > > latency stddev = 0.050 ms > > tps = 607734.407158 (including connections establishing) > > tps = 607918.118566 (excluding connections establishing) > > Yuck. Aside from the fact that performance tanks when the feature is > turned on A quick look at the former shows that it's primarily contention around the new OldSnapshotTimeMapLock not, on that hardware in that workload, the spinlock. Which isn't that surprising because it adds an exclusive lock to a path which doesn't contain any other exclusive locks these days... I have to say, I'm *highly* doubtful that it's ok to add an exclusive lock in a readonly workload to such an hot path, without any clear path forward how to fix that scalability issue. This doesn't apear to be requiring just a bit of elbow grease, but a fair bit more. > it seems that there is a significant effect even with it turned off. It looks that way, but I'd rather run a bit more careful and repeated tests to make sure about that part. At a factor of 5, as with the on/off tests, per-run varitions don't play a large role, but at smaller percentages it's worthwhile to put more care into it. If possible it'd be helpful to avoid a VM too... Andres -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers