From owner-freebsd-stable@FreeBSD.ORG Mon May 2 21:48:34 2005 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4CA4916A4CE for ; Mon, 2 May 2005 21:48:34 +0000 (GMT) Received: from bgo1smout1.broadpark.no (bgo1smout1.broadpark.no [217.13.4.94]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9BF4843D5F for ; Mon, 2 May 2005 21:48:33 +0000 (GMT) (envelope-from des@des.no) Received: from bgo1sminn1.broadpark.no ([217.13.4.93]) by bgo1smout1.broadpark.no (Sun Java System Messaging Server 6.1 HotFix 0.05 (built Oct 21 2004)) with ESMTP id <0IFV008UZTMSJ630@bgo1smout1.broadpark.no> for freebsd-stable@freebsd.org; Mon, 02 May 2005 23:42:28 +0200 (CEST) Received: from dsa.des.no ([80.203.228.37]) by bgo1sminn1.broadpark.no (Sun Java System Messaging Server 6.1 HotFix 0.05 (built Oct 21 2004)) with ESMTP id <0IFV00KUOTXVZM00@bgo1sminn1.broadpark.no> for freebsd-stable@freebsd.org; Mon, 02 May 2005 23:49:07 +0200 (CEST) Received: by dsa.des.no (Pony Express, from userid 666) id 90F5E45165; Mon, 02 May 2005 23:48:13 +0200 (CEST) Received: from xps.des.no (xps.des.no [10.0.0.12]) by dsa.des.no (Pony Express) with ESMTP id 4984345131; Mon, 02 May 2005 23:48:10 +0200 (CEST) Received: by xps.des.no (Postfix, from userid 1001) id 2A69533C39; Mon, 02 May 2005 23:48:10 +0200 (CEST) Date: Mon, 02 May 2005 23:48:10 +0200 From: des@des.no (=?iso-8859-1?q?Dag-Erling_Sm=F8rgrav?=) In-reply-to: <4276910A.3040100@criticalmagic.com> To: Richard Coleman Message-id: <867jih5mg5.fsf@xps.des.no> MIME-version: 1.0 Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: quoted-printable X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on dsa.des.no References: <426E5713.3010906@eurocom.od.ua> <747dc8f30504260812ee3c47e@mail.gmail.com> <426E5EA5.8000703@eurocom.od.ua> <426F3AFA.9020900@konvergencia.hu> <426F5A6E.4050208@eurocom.od.ua> <86acndmyky.fsf@xps.des.no> <4276910A.3040100@criticalmagic.com> User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3 (berkeley-unix) X-Spam-Status: No, score=-2.8 required=5.0 tests=ALL_TRUSTED,AWL autolearn=disabled version=3.0.2 X-Spam-Level: cc: Alexander Rusinov cc: freebsd-stable@freebsd.org Subject: Re: PostgreSQL in FreeBSD jails X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 May 2005 21:48:34 -0000 Richard Coleman writes: > It might be easier to hack PostgreSQL so that the shared memory > identifier depends not only on the port, but also on the IP address > (which will of course be different for each jail). Or better yet, to > be able to specify the shared memory identifier to use directly in the > config file. That's not a sufficiently general solution. First of all, in most setups postgresql runs either a) without TCP/IP; b) only on 127.0.0.1; c) on all interfaces. Very rarely does it listen only on one single identifiable IP address. Therefore, relying on the IP address is useless. Besides, the shm id is an integer, which makes it difficult to encode both the IP address and the port number without collisions. The ideal solution is to use a type of shared memory that does not need a namespace at all. One option is to use a threads instead of child processes. This would require a major rewrite of the backend, and is not likely to happen any time soon. The other option is to add support for mmap()-based shared memory. I happen to have a patch, but testing it properly and getting it approved and merged will take a while. DES --=20 Dag-Erling Sm=F8rgrav - des@des.no