Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Jun 2002 19:31:54 -0700
From:      Peter Wemm <peter@wemm.org>
To:        Terry Lambert <tlambert2@mindspring.com>, Alfred Perlstein <bright@mu.org>, Patrick Thomas <root@utility.clubscholarship.com>, freebsd-hackers@FreeBSD.ORG
Subject:   Re: tunings for many httpds... 
Message-ID:  <20020626023154.A70723910@overcee.wemm.org>
In-Reply-To: <20020626002318.C655D3811@overcee.wemm.org> 

next in thread | previous in thread | raw e-mail | index | archive | help
Peter Wemm wrote:

> There are no other differences.  The page table pages are still not shared
> (and live in process address space, not KVA) between multiple users of the
> SHM segment.  Sharing large SHM's many ways consumes physical memory for
> page table pages.  Non-phys-backed massively-shared SHM's also consume
> PV entries (28 bytes each), for which we set a fixed limit set at boot time.

Incidently, looking at the PV entry angle for a moment.  Suppose you
create a 1GB sysvshm (pageable) segment.  That's 262144 pages.  Mapping this
once means you consume 262144 PV entries.  At 28 bytes each, that is
about 7.3MB of KVM.  Now, fork this process 300 times.  The numbers become
78643200 PV entries taking up about 2.2GB of PV entries that would like to fit
in the 1G KVA space.  We dont even nearly have a way to fit all this in.

This is the killer reason for SHM_PHYS stuff.  It avoids the PV load which
has to fit into a single confined space.  The cost of the page table pages
sucks, but at least that is spread over the VM space of 300 processes.

If we could contigmalloc 4MB blocks, or have some configurable quantity of
4MB blocks set aside at boot, we could avoid all of this pain. :-) sysvshm
could arrange for that 1G of sysvshm to be wired in with 4MB chunks, skipping
the page table pages, PV entries and all.  Since the pages would have to
be partitioned off and "outside" the 4K page pool, they wouldn't have to be
demand paged.  [You either allocate them or you cannot].

One of the linux vendors did something like this at one point if I recall
correctly.  It was essential to make oracle perform respectably.

Cheers,
-Peter
--
Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com
"All of this is for nothing if we don't go to the stars" - JMS/B5


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




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