Received: from localhost (unknown [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 1516D2E3199 for ; Mon, 7 Jan 2008 20:01:52 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 86973-10 for ; Mon, 7 Jan 2008 20:01:43 -0400 (AST) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 91D552E3548 for ; Mon, 7 Jan 2008 20:01:35 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.1/8.14.1) with ESMTP id m0801WbR027656; Mon, 7 Jan 2008 19:01:33 -0500 (EST) To: Jakub Ouhrabka cc: pgsql-performance@postgresql.org Subject: Re: Linux/PostgreSQL scalability issue - problem with 8 cores In-reply-to: <4782AB4D.8010009@comgate.cz> References: <7083.1199379570@sss.pgh.pa.us> <477D1D59.7050002@comgate.cz> <4782063C.7070105@comgate.cz> <26502.1199745090@sss.pgh.pa.us> <4782AB4D.8010009@comgate.cz> Comments: In-reply-to Jakub Ouhrabka message dated "Mon, 07 Jan 2008 23:44:29 +0100" Date: Mon, 07 Jan 2008 19:01:32 -0500 Message-ID: <27655.1199750492@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200801/23 X-Sequence-Number: 28262 Jakub Ouhrabka writes: >>> Does your app create and destroy a tremendous number of temp tables, >>> or anything else in the way of frequent DDL commands? > Hmm. I can't think of anything like this. Maybe there are few backends > which create temp tables but not tremendous number. I don't think our > applications issue DDL statements either. Can LOCK TABLE IN EXCLUSIVE > MODE cause this? No. I did some experimenting to see exactly how large the sinval message buffer is in today's terms, and what I find is that about 22 cycles of create temp table foo (f1 int, f2 text); drop table foo; is enough to force a CatchupInterrupt to a sleeping backend. This case is a bit more complex than it appears since the text column forces the temp table to have a toast table; but even with only fixed-width columns, if you were creating one temp table a second that would be plenty to explain once-a-minute-or-so CatchupInterrupt processing. And if you've got a lot of backends that normally *don't* wake up that often, then they'd be sitting and failing to absorb the sinval traffic in any more timely fashion. So I'm betting that we've got the source of the spike identified. You could check this theory out by strace'ing some of the idle backends and seeing if their activity spikes are triggered by receipt of SIGUSR1 signals. regards, tom lane