Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 7 Jun 2001 17:02:52 -0700 (PDT)
From:      Matt Dillon <dillon@earth.backplane.com>
To:        Mike Meyer <mwm@mired.org>
Cc:        "Steve O'Hara-Smith" <steveo@eircom.net>, Mike Meyer <mwm@mired.org>, karsten@rohrbach.de, freebsd-stable@FreeBSD.ORG
Subject:   Re: building apache from /usr/ports
Message-ID:  <200106080002.f5802qo80210@earth.backplane.com>
References:  <JBEOKPCEMKJLMJAKBECCMELDDAAA.jwatkins@firstplan.com> <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>

next in thread | previous in thread | raw e-mail | index | archive | help

: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,
:	<mike
:--
:Mike Meyer <mwm@mired.org>			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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200106080002.f5802qo80210>