From owner-freebsd-stable Thu Jun 7 17: 3: 4 2001 Delivered-To: freebsd-stable@freebsd.org Received: from earth.backplane.com (earth-nat-cw.backplane.com [208.161.114.67]) by hub.freebsd.org (Postfix) with ESMTP id AE5E237B405 for ; Thu, 7 Jun 2001 17:03:00 -0700 (PDT) (envelope-from dillon@earth.backplane.com) Received: (from dillon@localhost) by earth.backplane.com (8.11.3/8.11.2) id f5802qo80210; Thu, 7 Jun 2001 17:02:52 -0700 (PDT) (envelope-from dillon) Date: Thu, 7 Jun 2001 17:02:52 -0700 (PDT) From: Matt Dillon Message-Id: <200106080002.f5802qo80210@earth.backplane.com> To: Mike Meyer Cc: "Steve O'Hara-Smith" , Mike Meyer , karsten@rohrbach.de, freebsd-stable@FreeBSD.ORG Subject: Re: building apache from /usr/ports References: <20010605140629.B15206@leviathan.inethouston.net> <20010605152718.A21889@localhost> <20010606034917.D97958@mail.webmonster.de> <15133.37451.23934.758674@guru.mired.org> <20010606081033.33f55fdf.steveo@eircom.net> <15135.64964.736928.819294@guru.mired.org> Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG :That's true for data, but not for code. That's also an unusual apache :configuration. I've never known anyone that didn't start just one, and :let it start the others, at least since they added virtual server :support. : :At this point, I don't know enough about shared libraries on FBSD. Is :the data segment shared COW amongst all the processes that are using :it, or does each process get one of it's own? : : Thanx, : http://www.mired.org/home/mwm/ :Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information. Shared libraries are mmap()'d but there's a bit of glue that must occur during startup, so for programs run separately 'most' of the shared library will be shared across the separately exec'd instances but a small amount will not. (This is verses a statically linked program where the linking occurs before the exec, allowing the entire thing to be shared across instances). For a shared library, 'small amount' in this case equates to 4-16K of unshareable memory per shared library. It can become significant. However, in a fork()ed model, where a server simply clones itself with fork(), the entire shared library including the glue pieces will be shared across all the children. So in a forking model it doesn't really matter whether the program is compiled static or shared. - Data sharing doesn't usually work quite as well as code sharing. The data segment for separately exec'd programs will be shared up until a program modifies it, after which it becomes private. This generally results in most of the data segment winding up in private hands. In a fork()ing model the data segment is again shared, but again any child that modifies a page in the data segment will get its own copy and, typically, a good portion of the data segment will wind up in private hands. -Matt To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message