Date: Mon, 02 May 2005 23:48:10 +0200 From: des@des.no (=?iso-8859-1?q?Dag-Erling_Sm=F8rgrav?=) To: Richard Coleman <rcoleman@criticalmagic.com> Cc: freebsd-stable@freebsd.org Subject: Re: PostgreSQL in FreeBSD jails Message-ID: <867jih5mg5.fsf@xps.des.no> In-Reply-To: <4276910A.3040100@criticalmagic.com> 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>
next in thread | previous in thread | raw e-mail | index | archive | help
Richard Coleman <rcoleman@criticalmagic.com> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?867jih5mg5.fsf>