Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id E182C1337BFC for ; Wed, 6 Oct 2010 22:25:15 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 63818-09 for ; Thu, 7 Oct 2010 01:25:08 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 782D71337BDD for ; Wed, 6 Oct 2010 22:25:08 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id o971P7uh016637; Wed, 6 Oct 2010 21:25:07 -0400 (EDT) To: Ivan Voras cc: pgsql-performance@postgresql.org Subject: Re: [HACKERS] MIT benchmarks pgsql multicore (up to 48)performance In-reply-to: References: <20101004175545.GA2690@csail.mit.edu> <4CAA21C7.1030701@agliodbs.com> Comments: In-reply-to Ivan Voras message dated "Thu, 07 Oct 2010 00:31:19 +0200" Date: Wed, 06 Oct 2010 21:25:07 -0400 Message-ID: <16636.1286414707@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201010/46 X-Sequence-Number: 40465 Ivan Voras writes: > On 10/04/10 20:49, Josh Berkus wrote: >>> The other major bottleneck they ran into was a kernel one: reading from >>> the heap file requires a couple lseek operations, and Linux acquires a >>> mutex on the inode to do that. > Hmmm... lseek? As in "lseek() then read() or write()" idiom? It AFAIK > cannot be fixed since you're modifying the global "strean position" > variable and something has got to lock that. Um, there is no "global stream position" associated with an inode. A file position is associated with an open-file descriptor. If Josh quoted the problem correctly, the issue is that the kernel is locking a file's inode (which may be referenced by quite a lot of file descriptors) in order to change the state of one file descriptor. It sure sounds like a possible source of contention to me. regards, tom lane