X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 637728B9C75 for ; Sat, 5 Feb 2005 19:01:51 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 41131-01 for ; Sat, 5 Feb 2005 19:01:35 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 7AA748B9C1D for ; Sat, 5 Feb 2005 19:01:35 +0000 (GMT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id j15J1X4r024849; Sat, 5 Feb 2005 14:01:33 -0500 (EST) To: Marinos Yannikos Cc: Oleg Bartunov , pgsql-performance@postgresql.org Subject: Re: GiST indexes and concurrency (tsearch2) In-reply-to: <4204C3B4.1050209@geizhals.at> References: <4201AEB1.4000504@geizhals.at> <4202053B.10207@geizhals.at> <4204C3B4.1050209@geizhals.at> Comments: In-reply-to Marinos Yannikos message dated "Sat, 05 Feb 2005 14:01:40 +0100" Date: Sat, 05 Feb 2005 14:01:32 -0500 Message-ID: <24848.1107630092@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200502/80 X-Sequence-Number: 10409 Marinos Yannikos writes: > This is really baffling me, it looks like a kernel issue of some sort > (I'm only guessing though). I found this old posting: > http://archives.postgresql.org/pgsql-general/2001-12/msg00836.php - is > this still applicable? That seems to be an early report of what we now recognize as the "context swap storm" problem, and no we don't have a solution yet. I'm not completely convinced that you're seeing the same thing, but if you're seeing a whole lot of semops then it could well be. I set up a test case consisting of two backends running the same tsearch2 query over and over --- nothing fancy, just one of the ones from the tsearch2 regression test: SELECT count(*) FROM test_tsvector WHERE a @@ to_tsquery('345&qwerty'); I used gdb to set breakpoints at PGSemaphoreLock and PGSemaphoreTryLock, which are the only two functions that can possibly block on a semop call. On a single-processor machine, I saw maybe one hit every couple of seconds, all coming from contention for the BufMgrLock or sometimes the LockMgrLock. So unless I've missed something, there's not anything in tsearch2 or gist per se that is causing lock conflicts. You said you're testing a quad-processor machine, so it could be that you're seeing the same lock contention issues that we've been trying to figure out for the past year ... regards, tom lane