From owner-freebsd-net@FreeBSD.ORG Wed Nov 17 21:03:22 2004 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 46A0C16A4CE for ; Wed, 17 Nov 2004 21:03:22 +0000 (GMT) Received: from mx01.bos.ma.towardex.com (mx01.bos.ma.towardex.com [65.124.16.9]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1C21843D1F for ; Wed, 17 Nov 2004 21:03:22 +0000 (GMT) (envelope-from haesu@mx01.bos.ma.towardex.com) Received: by mx01.bos.ma.towardex.com (TowardEX ESMTP 3.0p11_DAKN, from userid 1001) id 8326F2F940; Wed, 17 Nov 2004 16:03:21 -0500 (EST) Date: Wed, 17 Nov 2004 16:03:21 -0500 From: James To: Eugene Grosbein Message-ID: <20041117210321.GA73977@scylla.towardex.com> References: <20041117181351.GA48071@comp.chem.msu.su> <20041117185248.GA1394@grosbein.pp.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041117185248.GA1394@grosbein.pp.ru> User-Agent: Mutt/1.4.1i cc: Yar Tikhiy cc: net@freebsd.org Subject: Re: polling(4) rocks! X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Nov 2004 21:03:22 -0000 On Thu, Nov 18, 2004 at 01:52:49AM +0700, Eugene Grosbein wrote: > On Wed, Nov 17, 2004 at 09:13:51PM +0300, Yar Tikhiy wrote: > > > The router box is a 1.4GHz Celeron PC with an fxp(4) interface split > > across a dozen of vlans. There is nothing special about its setup > > except for ~250 rules loaded into ipfw2. It is running 4.10-RELEASE. > > Without polling, it was able to switch full 10Mbytes/sec of traffic > > (~9kpps), but that took from 50 to 70% CPU time spent in interrupts. > > With polling on, interrupt time never exceeds 5% and it stays as low > > as 1-2% on average even when traffic is that high. > > Does polling(4) increase latency? It is very imortant for router > that handles lots of RTP (VoIP) traffic. If you have a box doing lot of traffic in packets per second, enabling polling with HZ=2000 +/- will actually *decrease* latency due to far lower overhead instead of handling all those interrupts/sec. On a low-to-no traffic box, it's probably not worth it, however use your own judgement. Either way, the amount of latency polling(4) adds even in HZ=100 is very low enough (1 ms or less. if using 2000 or so, there is not much noticeable latency in line of microseconds) to affect most applications. -J -- James Jun TowardEX Technologies, Inc. Technical Lead IPv4 and Native IPv6 Colocation, Bandwidth, james@towardex.com and Web Hosting Services in the Metro Boston area cell: 1(978)-394-2867 web: http://www.towardex.com , noc: www.twdx.net