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 1mahQK-0007jH-Aw for pgsql-performance@arkaria.postgresql.org; Wed, 13 Oct 2021 16:48:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mahQI-00018b-T0 for pgsql-performance@arkaria.postgresql.org; Wed, 13 Oct 2021 16:48:10 +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 1mahQI-00018T-Be for pgsql-performance@lists.postgresql.org; Wed, 13 Oct 2021 16:48:10 +0000 Received: from mail-io1-xd36.google.com ([2607:f8b0:4864:20::d36]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mahQG-00021J-0K for pgsql-performance@lists.postgresql.org; Wed, 13 Oct 2021 16:48:09 +0000 Received: by mail-io1-xd36.google.com with SMTP id x1so423513iof.7 for ; Wed, 13 Oct 2021 09:48:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=M6teHswDlF/G/N+Ws07VuLRhaRmPHdEXr31KoDbnCy8=; b=noegLzpsWdjgqiNRuZji0MVPIK2wY4Mbt6zcUb8exQU5xLEsF1UMbuY3pBFneOqSXm UWFiP0/NHQkBueRqFHDaJHwGhDSes6KFgYuIuTduEKnuKHpKACSzvjES8+5LUb+nbcpe cBIn4PtqMaoWhzGQOb+/0LlCC5Te0q/s01yu2hKS1J/VpmUQ7ollMnHGl0ouqU+ocfmy ZPq+zEu9A/BBCJzRoH5dDmaITxizSA2y3FFencWJpm9tyQbrg3m5RnvrJ5/M/Fgvy7xZ WNScUxpAMg+aDIOpqNU9eGwMeCFJ+r8PD7kTInfVGeYFojtdvylwMa3+vjsGgjIBC6CO zT0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=M6teHswDlF/G/N+Ws07VuLRhaRmPHdEXr31KoDbnCy8=; b=wH3kD8qOp57PQw+uDoS29TIFQbaIXYRLPuCO/oC/+6v+sd/r7TYdwDrV/56YaEcBJQ M8fxhzz7OtkFMjFikNlWEz34sPvJoSd3tW9XFpDVjILOArY1unMh9cO0y21cKNm9Y54i wiOhalEl4RkU54q53/Ly3HPpA7bUSH/cI4j8wADZGzgYcYT1dymGin+6uZKnzBFLOKcq IlQtTrzns+cRhXbdCZ2WTM5rtS7ZpYt+0jK/LjVt6gYq6EKiScypRMfI6KpJ6lzKYEuv uWtBX+D3yjR9TuOHTHt0rRN6/A5IxPFIGqfNzOGOnBH75UaQ2K1lAroMTf5mDwVVJJsj PX8Q== X-Gm-Message-State: AOAM531kpHXTlCitmsGJ/SOoLVd1oekERAkkB/brz97WLyjryTs+vH45 NkuKLEC7rl4Yy504XYfiOcMuWlAD5dY= X-Google-Smtp-Source: ABdhPJyuZopJ6qisdfNOHcDYNqy2UYqkQa5rCm3LetEJcpmZjFClODN3ya/fD0ZWcckSz6mQDdgvZg== X-Received: by 2002:a6b:7415:: with SMTP id s21mr272808iog.168.1634143687061; Wed, 13 Oct 2021 09:48:07 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id b7sm19503ilq.65.2021.10.13.09.48.06 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Oct 2021 09:48:06 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id 0CCEC800837; Wed, 13 Oct 2021 11:48:05 -0500 (CDT) Date: Wed, 13 Oct 2021 11:48:05 -0500 From: Justin Pryzby To: Ashkil Dighin Cc: pgsql-performance@lists.postgresql.org Subject: Re: Lock contention high Message-ID: <20211013164805.GC27491@telsasoft.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Oct 12, 2021 at 01:05:12PM +0530, Ashkil Dighin wrote: > Hi, > Lock contention observed high in PostgreSQLv13.3 > The source code compiled with GNC(GCCv11.x) > PostgreSQL version: 13.3 > Operating system: RHEL8.3 > Kernel name:4.18.0-305.10.2.el8_4.x86_64 > RAM Size:512GB > SSD: 1TB > The environment used IBM metal and test benchmark environment HammerDbv4.2 > Test case :TPC-C > > Perf data for 24vu(TPC-C) > -------------------------------- > > 18.99% postgres postgres [.] LWLockAcquire > 7.09% postgres postgres [.] _bt_compare > 8.66% postgres postgres [.] LWLockRelease ... > 1.Is there a way to tune the lock contention ? > 2.Is any recommendations to tune/reduce the lock contention via postgres.conf I think you'd want to find *which* LW locks are being waited on, to see if it's something that can be easily tuned. You can check pg_stat_activity, or maybe create a cronjob to record its content for later analysis. -- Justin