From owner-freebsd-hackers Tue Aug 14 16: 7:49 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from elvis.mu.org (elvis.mu.org [216.33.66.196]) by hub.freebsd.org (Postfix) with ESMTP id 9888B37B40E; Tue, 14 Aug 2001 16:07:43 -0700 (PDT) (envelope-from bright@elvis.mu.org) Received: by elvis.mu.org (Postfix, from userid 1192) id 6885281D0D; Tue, 14 Aug 2001 18:07:33 -0500 (CDT) Date: Tue, 14 Aug 2001 18:07:33 -0500 From: Alfred Perlstein To: Zach Brown Cc: Terry Lambert , "Daniel M. Eischen" , Jonathan Chen , hackers@FreeBSD.ORG Subject: Re: pthreads and poll() Message-ID: <20010814180733.F38066@elvis.mu.org> References: <20010813120455.A63309@enterprise.spock.org> <3B780BFC.F2BA0A9B@vigrid.com> <3B79916D.FE1342E2@mindspring.com> <20010814184156.A4825@erasmus.off.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010814184156.A4825@erasmus.off.net>; from zab@zabbo.net on Tue, Aug 14, 2001 at 06:41:56PM -0400 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG * Zach Brown [010814 17:42] wrote: > [pulls out his dead horse..] > > > > one thread would wake up. The mistake in your sample seems to be that > > > you're having all threads block on the same fd. Why? > > > > Probably he has a bunch of daemons waiting around for work to > > do (e.g. HTTP daemons all listening for connections to accept > > on the same fd). Lot's of applications could use this model > > to get a performance boost. > > I have yet to see a 'thundering accept()' actually shown to be a > meaningful performance problem. Are there more than two significant > situations here? > > a) you have lots of idle servers waiting for work on an fd. it arrives, > they all wake up, only to find that one of them gets to do real work. > Who cares? you were idle. you had time to kill. The time when this > wouldn't be acceptable would be if there were _very_ tight response > time constraints. > > b) you're under load. your servers are off doing work under that load. > you rarely see a significant number of them waiting for new work at > the same time. wakeups (or scheduling) don't make up a meaningful > percentage of the real work (io, networking, app data crunching, etc) > that is being done. > > "b)" was the case at the zdnet benchmarks, though people ran around > screaming things about thundering accept()s apaches when not a one of > them had profiling runs in front of them :) > > I'm not saying that wake-one isn't a fine idea, I just keep seeing > references to the mystical thundering accept() wakeup problem and its > solution that brings better performance. I keep asking when people > mention it and no one has been able to show this to be the case based > on numbers. > > Am I insane? Not insane, just wrong. Picture a moderately loaded server, this is where the superfluous wakeups cause a moderately loaded server to go over the edge. Here's a reference about this: http://www.citi.umich.edu/projects/linux-scalability/reports/accept.html Linux was only about 5 years behind in discovering/implementing this. :) -- -Alfred Perlstein [alfred@freebsd.org] Ok, who wrote this damn function called '??'? And why do my programs keep crashing in it? To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message