From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 7 08:36:42 2005 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 A3F5516A4CE for ; Thu, 7 Apr 2005 08:36:42 +0000 (GMT) Received: from mail07.syd.optusnet.com.au (mail07.syd.optusnet.com.au [211.29.132.188]) by mx1.FreeBSD.org (Postfix) with ESMTP id C7D6F43D53 for ; Thu, 7 Apr 2005 08:36:41 +0000 (GMT) (envelope-from PeterJeremy@optushome.com.au) Received: from cirb503493.alcatel.com.au (c211-30-75-229.belrs2.nsw.optusnet.com.au [211.30.75.229]) j378aeuu005605 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Thu, 7 Apr 2005 18:36:40 +1000 Received: from cirb503493.alcatel.com.au (localhost.alcatel.com.au [127.0.0.1])j378ad7l089165; Thu, 7 Apr 2005 18:36:39 +1000 (EST) (envelope-from pjeremy@cirb503493.alcatel.com.au) Received: (from pjeremy@localhost)j378adxP089164; Thu, 7 Apr 2005 18:36:39 +1000 (EST) (envelope-from pjeremy) Date: Thu, 7 Apr 2005 18:36:39 +1000 From: Peter Jeremy To: ray@redshift.com Message-ID: <20050407083639.GD57256@cirb503493.alcatel.com.au> References: <42518AC9.5070208@comcast.net> <3.0.1.32.20050405052601.00ab4388@pop.redshift.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3.0.1.32.20050405052601.00ab4388@pop.redshift.com> User-Agent: Mutt/1.4.2i cc: freebsd-hackers@freebsd.org Subject: Re: Kernel [memory] tweaking question 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: Thu, 07 Apr 2005 08:36:42 -0000 On Tue, 2005-Apr-05 05:26:01 -0700, ray@redshift.com wrote: >options SHMALL= >options SHMMAX= >options SHMMAXPGS= >options SHMMIN= >options SHMMNI= >options SHMSEG= These are all reasonably well documented in sys/conf/NOTES. If you want more detail, try a SystemV-oriented Unix book >I understand these control shared memory and how many semaphores the >kernel can allocate, Close - they only control SystemV shared memory. Sane shared memory is available via mmap(2). SystemV semaphores are controlled via SEMxxx options. Posix semaphores are listed as 'experimental'. > but I guess what I'm not 100% clear on is how >the kernel uses these resources when it comes to running something >like Apache or MySQL on a heavily loaded server. These values all define limits on the amount of shared memory available system-wide (SHMALL and SHMMNI) and to a single process (remaining options). As far as I can tell, neither Apache nor MySQL use any SystemV IPC on FreeBSD. (The only thing that I've found that does use SHM is X in some modes). > In other words, for >something like Apache, how much shared memory is required? None. > Or what >would adding additional shared memory and/or semaphores provide. Nothing. >Does the default # provided for by FreeBSD create a problem and/or >would it use additional ram if allocated? Actually using SystemV IPC will use additional RAM. >Is there the anyone on the list that has experience with changing >these that can provide a clear, down to earth explanation as to their >impacts? I have used them on other Unices but never needed to tweak them on FreeBSD. Before adjusting anything, use ipcs(1) to confirm that they are being used. If you seem to be reaching limits (ipcs shows that you are close to system limits or the applications are reporting allocation errors), then just increase the parameter related to whatever you are running out of. -- Peter Jeremy