From owner-freebsd-questions@FreeBSD.ORG Tue Nov 14 23:56:28 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1B55F16A407 for ; Tue, 14 Nov 2006 23:56:28 +0000 (UTC) (envelope-from robin@reportlab.com) Received: from ptb-relay01.plus.net (ptb-relay01.plus.net [212.159.14.212]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1F26543D58 for ; Tue, 14 Nov 2006 23:56:27 +0000 (GMT) (envelope-from robin@reportlab.com) Received: from [87.114.7.214] (helo=[192.168.0.3]) by ptb-relay01.plus.net with esmtp (Exim) id 1Gk88f-0001Hf-JB; Tue, 14 Nov 2006 23:56:25 +0000 Message-ID: <455A57BD.3030006@jessikat.plus.net> Date: Tue, 14 Nov 2006 23:56:45 +0000 From: Robin Becker User-Agent: Thunderbird 1.5.0.8 (Windows/20061025) MIME-Version: 1.0 To: Damian Wiest References: <4559DF39.7070506@chamonix.reportlab.co.uk> <20061114224652.GE20235@dfwdamian.vail> <20061114231102.GF20235@dfwdamian.vail> In-Reply-To: <20061114231102.GF20235@dfwdamian.vail> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: sysv semaphores X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Nov 2006 23:56:28 -0000 Damian Wiest wrote: ......... >> You'll want to use either sysctl(8) to change the settings dynamically, or >> use /etc/sysctl.conf to modify the settings permanently. I'm not sure if >> there's a benefit to rolling a new kernel versus using sysctl.conf, or if >> things even work that way anymore. >> >> # sysctl -a | grep seminfo >> >> kern.seminfo.semmni=10 # number of semaphore identifiers >> kern.seminfo.semmns=60 # number of semaphores in system >> kern.seminfo.semmnu=30 # number of undo structures in system >> kern.seminfo.semmsl=60 # max number of semaphores per id >> kern.seminfo.semopm=100 # max number of operations per semop call >> kern.seminfo.semume=10 # max number of undo entries per process >> kern.seminfo.semusz=100 # size in bytes of undo structure >> kern.seminfo.semvmx=32767 # semaphore maximum value >> kern.seminfo.semaem=16384 # adjust on exit max value >> >> Those comments are from /usr/include/sys/sem.h >> >> -Damian > > Sorry, I forgot to mention a few things. > > You should become familiar with ipcs(1) as it will allow you to query > the current state of SysV IPC facilities. You'll probably find yourself > manually deleting semaphores depending on how well that extension cleans > up after itself during testing. > > IIRC, the kernel maintains some in-memory datastructures to keep track > of semaphores. I believe increasing the maximum number of semaphores > will take up a negligible amount of main memory. > > If you're interested, the "Design and Implementation of the 4.4 BSD > Operating System" (ISBN # 0201549794) has great coverage of this stuff. ........ thanks very much all very useful info. Someone else recommended looking at these options kern.ipc.semmap=180 kern.ipc.semmni=160 kern.ipc.semmns=210 kern.ipc.semmnu=180 kern.ipc.semmsl=210 kern.ipc.semopm=250 kern.ipc.semume=160 kern.ipc.semusz=92 kern.ipc.semvmx=32767 kern.ipc.semaem=16384 and on my 6.1 system I see these with sysctl -a | grep ipc, however, # sysctl -a | grep seminfo /usr/RL_HOME/users/robin: # I guess they've been renamed. -- Robin Becker