From owner-freebsd-questions@FreeBSD.ORG Mon Jun 27 03:13:26 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 A60E916A41C for ; Mon, 27 Jun 2005 03:13:26 +0000 (GMT) (envelope-from leblanc@keyslapper.net) Received: from russian-caravan.cloud9.net (russian-caravan.cloud9.net [168.100.1.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 600FD43D53 for ; Mon, 27 Jun 2005 03:13:26 +0000 (GMT) (envelope-from leblanc@keyslapper.net) Received: from russian-caravan.cloud9.net (localhost [127.0.0.1]) by russian-caravan.cloud9.net (Postfix) with SMTP id BC66B1A195 for ; Sun, 26 Jun 2005 23:13:25 -0400 (EDT) Received: from keyslapper.net (250-119.customer.cloud9.net [168.100.250.119]) by russian-caravan.cloud9.net (Postfix) with ESMTP id 09C4C19EB1 for ; Sun, 26 Jun 2005 23:13:24 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by keyslapper.net (Postfix) with ESMTP id B4FB7114A5 for ; Sun, 26 Jun 2005 23:13:23 -0400 (EDT) Received: from keyslapper.net ([127.0.0.1]) by localhost (keyslapper.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 00597-02 for ; Sun, 26 Jun 2005 23:13:23 -0400 (EDT) Received: by keyslapper.net (Postfix, from userid 1001) id 7699711489; Sun, 26 Jun 2005 23:13:23 -0400 (EDT) Date: Sun, 26 Jun 2005 23:13:23 -0400 From: Louis LeBlanc To: freebsd-questions@freebsd.org Message-ID: <20050627031323.GA1156@keyslapper.net> Mail-Followup-To: freebsd-questions@freebsd.org References: <20050626191706.GB89575@keyslapper.net> <20050626223917.3b50913b.albi@scii.nl> <20050626205620.GC89575@keyslapper.net> <20050626142104.L1638@sotec.home> <20050626224825.GB970@keyslapper.net> <20050626163239.T1138@sotec.home> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="gKMricLos+KVdGMg" Content-Disposition: inline In-Reply-To: <20050626163239.T1138@sotec.home> X-PGP-Key: http://www.keyslapper.net/~leblanc/leblanc-at-keyslapper-net.asc User-Agent: Mutt/1.5.9i X-Virus-Scanned: amavisd-new at keyslapper.net X-AntiVirus: Checked by Vexira Antivirus v1.5 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 Reply-To: freebsd-questions@FreeBSD.org List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jun 2005 03:13:26 -0000 --gKMricLos+KVdGMg Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 06/26/05 04:50 PM, Mikko Tyljrvi sat at the `puter and typed: > > > > 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 >=20 > Ok, looks like the default settings, which are often too low for > anything that makes heavy use of SYSV IPCs... >=20 > > > > # 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 >=20 > ... such as databases :-) >=20 > Have a look at /usr/ports/databases/postgresql80-server/pkg-message-server > for some sample settings. >=20 > > 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? >=20 > Not necessarily. The SYSV IPCs is a particularly vicious piece of > poor engineering. >=20 > 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. >=20 > Easy, right? >=20 > Looks like you'll have to use "ipcs -sa" to see the "NSEMS" column, > which should tell you how many semaphores are in use. >=20 > > How many does it need to open? >=20 > No idea. Read the code or just raise the retarded limits by a lot. > Or try stopping postgres while running the tests. >=20 > $.02, And then some. You called this one right on the nose. ipcs -sa showed each of the 3 pgsql processes were using 17 semaphores (NSEMS column) wich really did cut things down. The pkg-message-server file shed some light too. I first shut down postgres, then ran the test, and everything worked fine. Then I added the 3 lines below to /boot/loader.conf, then rebooted and ran the tests again with postgres still running, and everything worked fine again. kern.ipc.semmns=3D240 kern.ipc.semume=3D40 kern.ipc.semmnu=3D120 So, I suspect I have enough semaphores for awhile now: $ ipcs -S seminfo: semmap: 30 (# of entries in semaphore map) semmni: 10 (# of semaphore identifiers) semmns: 240 (# of semaphores in system) semmnu: 120 (# of undo structures in system) semmsl: 60 (max # of semaphores per id) semopm: 100 (max # of operations per semop call) semume: 40 (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) Thanks again. Lou --=20 Louis LeBlanc FreeBSD-at-keyslapper-DOT-net Fully Funded Hobbyist, KeySlapper Extrordinaire :) Please send off-list email to: leblanc at keyslapper d.t net Key fingerprint =3D C5E7 4762 F071 CE3B ED51 4FB8 AF85 A2FE 80C8 D9A2 Logg's Rebuttal to Gray's Law: `n+1' trivial tasks take twice as long as `n' trivial tasks. --gKMricLos+KVdGMg Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (FreeBSD) iD8DBQFCv27Tr4Wi/oDI2aIRAtrrAJ99ISd0Eb9MSzol4JeimhhfYW3PGQCbBdAy y8kozDy3XLcA72hNX9fxOTo= =T2I3 -----END PGP SIGNATURE----- --gKMricLos+KVdGMg--