Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VLvGo-0004wP-OK for pgsql-performance@arkaria.postgresql.org; Tue, 17 Sep 2013 13:24:46 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VLvGo-0008GS-4B for pgsql-performance@arkaria.postgresql.org; Tue, 17 Sep 2013 13:24:46 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VLvGm-0008Ey-MQ for pgsql-performance@postgresql.org; Tue, 17 Sep 2013 13:24:44 +0000 Received: from moutng.kundenserver.de ([212.227.126.187]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VLvGj-0000iR-Kx for pgsql-performance@postgresql.org; Tue, 17 Sep 2013 13:24:44 +0000 Received: from anarazel.de (p5DDC4CBE.dip0.t-ipconnect.de [93.220.76.190]) by mrelayeu.kundenserver.de (node=mrbap1) with ESMTP (Nemesis) id 0M2FjY-1WDtQy10S4-00scew; Tue, 17 Sep 2013 15:24:40 +0200 Received: by anarazel.de (Postfix, from userid 1000) id 7DA8B100D8A; Tue, 17 Sep 2013 15:24:39 +0200 (CEST) Date: Tue, 17 Sep 2013 15:24:39 +0200 From: Andres Freund To: Merlin Moncure Cc: =?utf-8?B?0JTQvNC40YLRgNC40Lkg0JTQtdCz0YLRj9GA0ZHQsg==?= , postgres performance list Subject: Re: Cpu usage 100% on slave. s_lock problem. Message-ID: <20130917132439.GD5452@awork2.anarazel.de> References: <20130827155556.GA9061@awork2.anarazel.de> <20130917115926.GA5452@awork2.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Content-Transfer-Encoding: quoted-printable X-Provags-ID: V02:K0:g+zKncknofflc6Fd0DdHD9NQZQMTHffXOIy/BB39NRm 1H3/WR+SNLp1Qa3H65bPMs2oytzzfHGiHp70xxAtHY2lUpKZL/ tUS8RqsM7eCb5w77zmwMzXO8Pp7XSE2xKp5NPq8b0Q9c+pE4B3 BaU04feNcSY87SoaFR1RmAMttNvGxgXRqMHK/tSUZzj6ZI4Sfu 2WDynjLbgQdsF4L2IDzUqUGq3/ROzU0aQLVlXS2HpjZ1ufyLBU yEJ95B0olmKWywq29LXkuOT7oooxYLB8fDiMa7WEOJ5ArlypPM zwM9DG/EiUhQH6i31E+RYOCn7gkOByr/VwMQbX/fUF8H+vybZS KuqU0cIEh2b35j134iUqbzHjsTKG8GOV2i/LZ5Sc7 X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org On 2013-09-17 08:18:54 -0500, Merlin Moncure wrote: > On Tue, Sep 17, 2013 at 6:59 AM, Andres Freund w= rote: > > Hi, > > > > On 2013-09-17 17:55:01 +0600, =D0=94=D0=BC=D0=B8=D1=82=D1=80=D0=B8=D0= =B9 =D0=94=D0=B5=D0=B3=D1=82=D1=8F=D1=80=D1=91=D0=B2 wrote: > >> We have not been able to reproduce this problem on a test servers. Use= this > >> patch to production servers do not dare. > >> > >> In the course of studying the problems we have identified that many qu= eries > >> are executed on the slave several times slower. On master function > >> heap_hot_search_buffer execute 100 cycles, on the slave the same query= with > >> the same plan function heap_hot_search_buffer execute 2000 cycles. > >> Also, we were able to reproduce the problem on the master and detect t= hat > >> there s_lock of slow queries. > > > > What you describe is normally an indication that you have too many > > longrunning transactions around preventing hot pruning from working. >=20 > Do you think it's worth submitting the lock avoidance patch for formal re= view? You mean the bufmgr.c thing? Generally I think that that code needs a good of scalability work - there's a whole thread about it somewhere. But TBH the theories you've voiced about the issues you've seen haven't convinced me so far. If you can manage to prove it has a benefit in some case that's reproducable - why not go ahead? Quick question: Do you happen to have pg_locks output from back then around? We've recently found servers going into somewhat similar slowdowns because they exhausted the fastpath locks which made lwlocks far more expensive and made s_lock go up very high in the profle. Greetings, Andres Freund --=20 Andres Freund http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services --=20 Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance