From owner-freebsd-hackers@FreeBSD.ORG Wed May 7 00:27:51 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CAAAD37B401 for ; Wed, 7 May 2003 00:27:51 -0700 (PDT) Received: from puffin.mail.pas.earthlink.net (puffin.mail.pas.earthlink.net [207.217.120.139]) by mx1.FreeBSD.org (Postfix) with ESMTP id 394C943F3F for ; Wed, 7 May 2003 00:27:51 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from pool0555.cvx40-bradley.dialup.earthlink.net ([216.244.44.45] helo=mindspring.com) by puffin.mail.pas.earthlink.net with asmtp (SSLv3:RC4-MD5:128) (Exim 3.33 #1) id 19DJL8-0001LZ-00; Wed, 07 May 2003 00:27:47 -0700 Message-ID: <3EB8B4F1.78C037A9@mindspring.com> Date: Wed, 07 May 2003 00:25:37 -0700 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: andykinney@advantagecom.net References: <3EB7DA83.24126.24BD4CE5@localhost> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-ELNK-Trace: b1a02af9316fbb217a47c185c03b154d40683398e744b8a417e3d1efe850d91fa2411b150be4f1f3350badd9bab72f9c350badd9bab72f9c350badd9bab72f9c cc: freebsd-hackers@freebsd.org Subject: Re: collecting pv entries -- suggest increasing PMAP_SHPGPERPROC X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2003 07:27:52 -0000 Andrew Kinney wrote: > PV Entries are directly related the number of simultaneous children > processes Apache is allowed to spawn. > > To figure out how many PV entries your system is using per > Apache process, run this command: > > ipcs -a ; sysctl vm.zone | grep PV > > Take a look at the "shared" memory section and find the NATTCH > value for Apache. That number is the total number of Apache > processes that have attached to that shared memory segment. > > The last line of output is your PV entry stats. The third number in > from the left is the number of PV entries currently in use. Another alternative is to change the code that's doing the attaching, or move the attach into a module that persists over a fork, before the fork. My preference would be to convert to mmap() of /dev/zero to get anonymouns memory and call minherit() with INHERIT_SHARE before the fork. Worst case, you can have a before-the-fork and an after-the-fork module, and create it before and save where it lives in a file somewhere to communicate the information. Then all the PV entries get shared. -- Terry