From owner-freebsd-performance@FreeBSD.ORG Tue Nov 23 00:30:07 2010 Return-Path: Delivered-To: freebsd-performance@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ED38F106564A for ; Tue, 23 Nov 2010 00:30:07 +0000 (UTC) (envelope-from gofp-freebsd-performance@m.gmane.org) Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by mx1.freebsd.org (Postfix) with ESMTP id 963DF8FC15 for ; Tue, 23 Nov 2010 00:30:06 +0000 (UTC) Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1PKglp-0007v4-FE for freebsd-performance@freebsd.org; Tue, 23 Nov 2010 01:30:05 +0100 Received: from cpe-188-129-85-205.dynamic.amis.hr ([188.129.85.205]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 23 Nov 2010 01:30:05 +0100 Received: from ivoras by cpe-188-129-85-205.dynamic.amis.hr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 23 Nov 2010 01:30:05 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-performance@freebsd.org From: Ivan Voras Date: Tue, 23 Nov 2010 01:26:27 +0100 Lines: 38 Message-ID: References: <4CEA9C46.8010507@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: cpe-188-129-85-205.dynamic.amis.hr User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.12) Gecko/20101102 Thunderbird/3.1.6 In-Reply-To: <4CEA9C46.8010507@freebsd.org> Subject: Re: PostgreSQL performance scaling X-BeenThere: freebsd-performance@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Performance/tuning List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Nov 2010 00:30:08 -0000 On 11/22/10 17:37, David Xu wrote: > Mark Felder wrote: >> I recommend posting this on the Postgres performance list, too. >> >> >> >> >> Regards, >> >> >> Mark > > I think if PostgreSQL uses semaphore for inter-process locking, > it might be a good idea to use POSIX semaphore exits in our head > branch, the new POSIX semaphore implementation now supports > process-shared, and is more light weight than SYSV semaphore, > if there is no contention, a process need not enter kernel to > acquire/release a lock. Note that I have just fixed a bug in head > branch. However RELENG_8 does not support process-shared semaphore > yet. Another thing might be that, despite that they appear to try to avoid it, they possibly have a large number of processes hanging on the same semaphore, leading to thundering herd problem. There already is code for POSIX semaphores in PostgreSQL. It requires some manual fiddling with the configuration to enable (USE_UNNAMED_POSIX_SEMAPHORES). However, I've just tried it on 9-CURRENT and it doesn't work: Nov 23 01:23:02 biggie postgres[1515]: [1-1] FATAL: sem_init failed: No space left on device PostgreSQL calls it as "sem_init(sem, 1, 1);" One more thing: apparently I had to kldload sem.ko - which looks like an error, since it is in GENERIC in 8-STABLE !