Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bFRqP-0007gr-J6 for pgsql-bugs@arkaria.postgresql.org; Tue, 21 Jun 2016 20:00:21 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bFRqP-0007TR-5U for pgsql-bugs@arkaria.postgresql.org; Tue, 21 Jun 2016 20:00:21 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bFRpk-0006i8-LW for pgsql-bugs@postgresql.org; Tue, 21 Jun 2016 19:59:40 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bFRpd-0002sd-Ss for pgsql-bugs@postgresql.org; Tue, 21 Jun 2016 19:59:39 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id u5LJxPFj016861; Tue, 21 Jun 2016 15:59:25 -0400 From: Tom Lane To: sobomax@freebsd.org cc: pgsql-bugs@postgresql.org Subject: Re: BUG #14206: Switch to using POSIX semaphores on FreeBSD In-reply-to: <20160621193412.5792.65085@wrigleys.postgresql.org> References: <20160621193412.5792.65085@wrigleys.postgresql.org> Comments: In-reply-to sobomax@freebsd.org message dated "Tue, 21 Jun 2016 19:34:12 -0000" Date: Tue, 21 Jun 2016 15:59:25 -0400 Message-ID: <16860.1466539165@sss.pgh.pa.us> X-Pg-Spam-Score: -3.3 (---) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org sobomax@freebsd.org writes: > However, according to the analysis done by Konstantin Belousov here > https://www.kib.kiev.ua/kib/pgsql_perf_v2.0.pdf there is at the very least > some performance benefit on using POSIX semaphones instead of SYSV > semaphones in the PG running on FreeBSD host. I wonder how thorough that performance testing was. The reason that the named-POSIX-semaphore code exists is that it used to be the only kind of semaphore available on ancient OS X versions. But we got rid of that as soon as we could, for the reason explained in template/darwin: # Select appropriate semaphore support. Darwin 6.0 (Mac OS X 10.2) and up # support System V semaphores; before that we have to use POSIX semaphores, # which are less good for our purposes because they eat a file descriptor # per backend per max_connection slot. The extra FDs slow down launching of new backends (due to having to dup all the postmaster's FDs for the semaphores) and if max_connections is large they can take a pretty serious chunk out of your system-wide file table, at worst max_connections squared. Now maybe FreeBSD is different enough from OSX that these are not problems for you, but I'm dubious. Have you got unnamed POSIX semaphores, and if so have you tried that variant? regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs