From owner-freebsd-hackers@FreeBSD.ORG Wed Feb 22 00:43:40 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 06D0F16A470 for ; Wed, 22 Feb 2006 00:43:40 +0000 (GMT) (envelope-from mike@sentex.net) Received: from smarthost2.sentex.ca (smarthost2.sentex.ca [205.211.164.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 917C343D45 for ; Wed, 22 Feb 2006 00:43:39 +0000 (GMT) (envelope-from mike@sentex.net) Received: from BLUELAPIS.sentex.ca (cage.simianscience.com [64.7.134.1]) by smarthost2.sentex.ca (8.13.4/8.13.4) with SMTP id k1M0hbuj040597; Tue, 21 Feb 2006 19:43:37 -0500 (EST) (envelope-from mike@sentex.net) From: Mike Tancsa To: FreeLSD Date: Tue, 21 Feb 2006 19:43:42 -0500 Message-ID: References: <20060221165456.GZ44603@rea.mbslab.kiae.ru> In-Reply-To: <20060221165456.GZ44603@rea.mbslab.kiae.ru> X-Mailer: Forte Agent 1.93/32.576 English (American) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.51 on 205.211.164.50 Cc: freebsd-hackers@freebsd.org Subject: Re: FreeBSD-6 and em interface speed X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Feb 2006 00:43:41 -0000 On Tue, 21 Feb 2006 19:54:56 +0300, in sentex.lists.freebsd.hackers you wrote: > Good day! > I've obtained the following strang results with the em Ethernet = interface >speeds on a 6.1-PRERELEASE: > Polling on: > UDP stream to FreeBSD: 327843.84 Kbit/sec, > TCP stream to FreeBSD: 524550.12 Kbit/sec. > Polling off: > UDP stream to FreeBSD: 740409.38 Kbit/sec, > TCP stream to FreeBSD: 794348.44 Kbit/sec. > > It is funny that TCP speed is greater than UDP. It can be related to = the >hardware, not to the OS, because I've seen such behaviour on a = linux-2.6. >But on linux-2.4 with the same hardware as for FreeBSD and with the same >source host I've got > UDP stream to Linux: 927891.44 Kbit/sec, > TCP stream to Linux: 850202.50 Kbit/sec. >The figures are higher and UDP rate > TCP rate. > I found that setting kern.polling.idle_poll=3D1 made a big difference to the forwarding rate. Also, on your tcp tests, try sysctl -w net.inet.tcp.inflight.enable=3D0 You might also adjust the amount of CPU allocated to userland when using polling. Without polling, I found I was able to livelock the middle box with just a dozen rules. I had=20 =46reeBSD boxA ------FreeBSD-B---FreeBSD-C Where=20 A =3D AMD 3800 with PCI-e BGE B =3D P4 3Ghz with PCI-X 82546EB Dual Port Gigabit=20 C =3D AMD 3800 with PCI-e BGE using netrate and iperf from A to C going across B, I had to switch to polling so as not to live lock B using /usr/src/tools/tools/netrate/netblast. Without ipfw or pflog, it was not an issue. but load up ipfw or pf, B would become unresponsive in non polling mode. > The questions: can anyone explain the relation 'TCP rate > UDP rate'? = Why >polling slows down the interface? And can FreeBSD stack can be tuned to >get the Linux performance? > > Kernel config deviations from GENERIC: >options SCHED_ULE get rid of that and use SCHED_4BSD ---Mike >options ADAPTIVE_GIANT >device pf >device pflog >device pfsync > > System is running at hz =3D 1000. > > Thanks! -------------------------------------------------------- Mike Tancsa, Sentex communications http://www.sentex.net Providing Internet Access since 1994 mike@sentex.net, (http://www.tancsa.com)