From owner-freebsd-questions@FreeBSD.ORG Sun Jun 26 23:50:48 2005 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 E4A8216A41C for ; Sun, 26 Jun 2005 23:50:47 +0000 (GMT) (envelope-from mbsd@pacbell.net) Received: from ylpvm12.prodigy.net (ylpvm12-ext.prodigy.net [207.115.57.43]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9E75743D48 for ; Sun, 26 Jun 2005 23:50:47 +0000 (GMT) (envelope-from mbsd@pacbell.net) Received: from ylpvm01.prodigy.net (ylpvm01-int.prodigy.net [207.115.5.207]) by ylpvm12.prodigy.net (8.12.10 outbound/8.12.10) with ESMTP id j5QNojG2004144 for ; Sun, 26 Jun 2005 19:50:45 -0400 Received: from sotec.home (adsl-64-166-22-206.dsl.snfc21.pacbell.net [64.166.22.206]) by ylpvm01.prodigy.net (8.13.4 dk-milter linux/8.13.4) with ESMTP id j5QNoRjr026687 for ; Sun, 26 Jun 2005 19:50:36 -0400 Date: Sun, 26 Jun 2005 16:50:21 -0700 (PDT) From: =?ISO-8859-1?Q?Mikko_Ty=F6l=E4j=E4rvi?= X-X-Sender: mikko@sotec.home To: freebsd-questions@FreeBSD.org In-Reply-To: <20050626224825.GB970@keyslapper.net> Message-ID: <20050626163239.T1138@sotec.home> References: <20050626191706.GB89575@keyslapper.net> <20050626223917.3b50913b.albi@scii.nl> <20050626205620.GC89575@keyslapper.net> <20050626142104.L1638@sotec.home> <20050626224825.GB970@keyslapper.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Subject: Re: Perl 5.8.6 to 5.8.7 upgrade fails IPC tests 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: Sun, 26 Jun 2005 23:50:48 -0000 On Sun, 26 Jun 2005, Louis LeBlanc wrote: > On 06/26/05 02:32 PM, Mikko Tyljrvi sat at the `puter and typed: >> On Sun, 26 Jun 2005, Louis LeBlanc wrote: >> >>> On 06/26/05 10:39 PM, albi@scii.nl sat at the `puter and typed: >>>> On Sun, 26 Jun 2005 15:17:06 -0400 >>>> Louis LeBlanc wrote: >>>> >>>>> I'm having a little trouble with my perl upgrade from 5.8.6 to 5.8.7. >>>> -- cut -- >>>>> ok 5 >>>>> ok 6 >>>>> semget: No space left on device >>>> >>>> you need to make disc-space, one idea is to run portsclean -C or to make >>>> some more space in /usr/home >>> >>> That would be the obvious cause, but not so: >> >> [...] >> >> Indeed. Disk space most likely has nothing to do with it. >> >> The semget(2) call returns ENOSPC when unable to allocate semaphores, >> due to hitting one of the many SYSV IPC limitations. Some things to >> look for: >> >> - You need to have SYSVSEM in your kernel, or "sysvsem.ko" loaded. >> >> - Check semaphore limits with "ipcs -S" >> >> - Check current semaphore usage with "ipcs -s" >> >> - Figure out what limit is being hit and do something about it :-) >> >> Some of the values can be tweaked at run-time, with >> "sysctl kern.ipc.semxxx=value", others have to be set at boot >> time (in /boot/loader.conf), or compiled into the kernel. > > This certainly does make sense, but I'm not sure I'm actually running > short here. I have SYSVSEM in my kernel (as well as SYSVSHM and > SYSVMSG), and the relevant sysctls are: > > kern.ipc.semmap: 30 > kern.ipc.semmni: 10 > kern.ipc.semmns: 60 > kern.ipc.semmnu: 30 > kern.ipc.semmsl: 60 > kern.ipc.semopm: 100 > kern.ipc.semume: 10 > kern.ipc.semusz: 92 > kern.ipc.semvmx: 32767 > kern.ipc.semaem: 16384 Ok, looks like the default settings, which are often too low for anything that makes heavy use of SYSV IPCs... > > # ipcs -S > seminfo: > semmap: 30 (# of entries in semaphore map) > semmni: 10 (# of semaphore identifiers) > semmns: 60 (# of semaphores in system) > semmnu: 30 (# of undo structures in system) > semmsl: 60 (max # of semaphores per id) > semopm: 100 (max # of operations per semop call) > semume: 10 (max # of undo entries per process) > semusz: 92 (size in bytes of undo structure) > semvmx: 32767 (semaphore maximum value) > semaem: 16384 (adjust on exit max value) > > # ipcs -s > Semaphores: > T ID KEY MODE OWNER GROUP > s 65536 5432001 --rw------- pgsql pgsql > s 65537 5432002 --rw------- pgsql pgsql > s 65538 5432003 --rw------- pgsql pgsql ... such as databases :-) Have a look at /usr/ports/databases/postgresql80-server/pkg-message-server for some sample settings. > Near as I can tell, this tells me I have at least 60 semaphores > systemwide, 60 per id, 3 in use, none of which are being used by root > (which is who I am running the test as). Shouldn't that leave 57 for > the perl tests? Not necessarily. The SYSV IPCs is a particularly vicious piece of poor engineering. Semaphores come in sets containing one or more semaphore. With your settings you can have at most 10 sets, and a total of at most 60 semaphores, and at most 60 per set, and at most 30... something else. Also, at most 30 locks can be released in case a process unexpectedly exits. Easy, right? Looks like you'll have to use "ipcs -sa" to see the "NSEMS" column, which should tell you how many semaphores are in use. > How many does it need to open? No idea. Read the code or just raise the retarded limits by a lot. Or try stopping postgres while running the tests. $.02, /Mikko