From owner-freebsd-net@FreeBSD.ORG Tue Jul 15 23:19:15 2008 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 713921065679 for ; Tue, 15 Jul 2008 23:19:15 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outO.internet-mail-service.net (outo.internet-mail-service.net [216.240.47.238]) by mx1.freebsd.org (Postfix) with ESMTP id 4AC008FC14 for ; Tue, 15 Jul 2008 23:19:15 +0000 (UTC) (envelope-from julian@elischer.org) Received: from idiom.com (mx0.idiom.com [216.240.32.160]) by out.internet-mail-service.net (Postfix) with ESMTP id 29BB92481; Tue, 15 Jul 2008 16:19:15 -0700 (PDT) Received: from julian-mac.elischer.org (localhost [127.0.0.1]) by idiom.com (Postfix) with ESMTP id 7EED32D6028; Tue, 15 Jul 2008 16:19:14 -0700 (PDT) Message-ID: <487D2FF0.7000706@elischer.org> Date: Tue, 15 Jul 2008 16:17:04 -0700 From: Julian Elischer User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: Bakul Shah References: <20080715230917.DAC3B5B46@mail.bitblocks.com> In-Reply-To: <20080715230917.DAC3B5B46@mail.bitblocks.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: =?windows-1252?Q?JINMEI_Tatuya_/_=3F=3F=3F=3F?= , Kris Kennaway , Thomas Vogt , freebsd-net@freebsd.org Subject: Re: too many open file descriptors messages since bind 9.4.2-P1 (port dns94) X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2008 23:19:15 -0000 Bakul Shah wrote: > On Tue, 15 Jul 2008 15:39:09 PDT JINMEI Tatuya / =?ISO-2022-JP?B?GyRCP0BMQEMjOkgbKEI=?= wrote: >> At Tue, 15 Jul 2008 15:12:31 -0700, >> Bakul Shah wrote: >> >>>> Besides, I guess that the P1 versions severely suffer from heavy >>>> overhead of select(2) when it regularly opens more than 1000 sockets. >>>> Even if 'too many open file' messages are gone, many users won't >>>> accept the increased load due to the overhead. Beta versions use >>>> kqueue, eliminating the fundamental overhead as well as the (too low) >>>> limitation of # of descriptors. >>> Or more portably you can use poll(2). >> I've not played with poll(2) in BIND9, but as far as I understand it, >> it doesn't solve the fundamental overhead issue here. For example, >> the application should examine all possible descriptors even if only a >> few of them are readable. > > IIRC, when poll() returns n, you only look at the first n > values in the pollfd array so it is a win when you expect a > very small number of fds to be ready. In the select case you > have to test the bit array until you see the last ready fd. > >> Anyway, since this is a FreeBSD specific list, I believe we can safely >> assume the existence of kqueue, unless we are talking about a very old >> version:-) > > Presumably kqueue has a lower cpu usage until the system gets > loaded at which point polling might win. I don't think so, since kqueue only runs code associated with events that have actually happened, and then only once until it's processed where las I looked poll had more to do on each call. also kqueue allows you to associate arbitrary identification informnation with each event so you don't have to have extra code to go from the fd to the event.. It's just way more efficient. > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"