From owner-freebsd-performance@FreeBSD.ORG Tue Apr 10 22:09:25 2007 Return-Path: X-Original-To: performance@FreeBSD.org Delivered-To: freebsd-performance@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4ACFA16A401; Tue, 10 Apr 2007 22:09:25 +0000 (UTC) (envelope-from kris@obsecurity.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 36E5013C465; Tue, 10 Apr 2007 22:09:25 +0000 (UTC) (envelope-from kris@obsecurity.org) Received: from obsecurity.dyndns.org (elvis.mu.org [192.203.228.196]) by elvis.mu.org (Postfix) with ESMTP id 1026F1A4D81; Tue, 10 Apr 2007 15:09:31 -0700 (PDT) Received: by obsecurity.dyndns.org (Postfix, from userid 1000) id 2BB5651566; Tue, 10 Apr 2007 18:09:24 -0400 (EDT) Date: Tue, 10 Apr 2007 18:09:24 -0400 From: Kris Kennaway To: Tom Lane Message-ID: <20070410220923.GA74088@xor.obsecurity.org> References: <20070226002234.GA80974@xor.obsecurity.org> <461B69C0.4060707@paradise.net.nz> <20070410184304.GB44123@xor.obsecurity.org> <3721.1176240977@sss.pgh.pa.us> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="+QahgC5+KEYLbs62" Content-Disposition: inline In-Reply-To: <3721.1176240977@sss.pgh.pa.us> User-Agent: Mutt/1.4.2.2i Cc: pgsql-hackers , performance@FreeBSD.org, current@FreeBSD.org, Mark Kirkwood , Kris Kennaway Subject: Re: [HACKERS] Anyone interested in improving postgresql scaling? X-BeenThere: freebsd-performance@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Performance/tuning List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2007 22:09:25 -0000 --+QahgC5+KEYLbs62 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Apr 10, 2007 at 05:36:17PM -0400, Tom Lane wrote: > Kris Kennaway writes: > > I have not studied the exact code path, but there are indeed multiple > > wakeups happening from the semaphore code (as many as the number of > > active postgresql processes). It is easy to instrument > > sleepq_broadcast() and log them when they happen. >=20 > There are certainly cases where Postgres will wake up a number of > processes in quick succession, but that should happen from a separate > semop() kernel call, on a different semaphore, for each such process. > If there's really multiple processes being released by the same semop() > then there's a bug we need to look into (or maybe it's a kernel bug?). > Anyway I'd be interested to know what the test case is, and which PG > version you were testing. I used 8.2 (and some older version when I first noticed it a year ago) and either sysbench or supersmack will show it - presumably anything that makes simultaneous queries. Just instrument sleepq_broadcast() to e.g. log a KTR event when it wakes more than 1 process and you'll see it happening. Kris --+QahgC5+KEYLbs62 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (FreeBSD) iD8DBQFGHAsTWry0BWjoQKURAuEBAKCWokB1FVD2u9Ldy2OqutQGbU1pOQCgsRE8 NsPcoUax8YkEbnXR7mY9SBE= =6la/ -----END PGP SIGNATURE----- --+QahgC5+KEYLbs62--