FreeBSD-6 and em interface speed
mike at sentex.net
Tue Feb 21 16:43:41 PST 2006
On Tue, 21 Feb 2006 19:54:56 +0300, in sentex.lists.freebsd.hackers
> 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=1 made a big difference to
the forwarding rate. Also, on your tcp tests, try
sysctl -w net.inet.tcp.inflight.enable=0
You might also adjust the amount of CPU allocated to userland when
Without polling, I found I was able to livelock the middle box with
just a dozen rules. I had
FreeBSD boxA ------FreeBSD-B---FreeBSD-C
A = AMD 3800 with PCI-e BGE
B = P4 3Ghz with PCI-X 82546EB Dual Port Gigabit
C = 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:
get rid of that and use SCHED_4BSD
> System is running at hz = 1000.
Mike Tancsa, Sentex communications http://www.sentex.net
Providing Internet Access since 1994
mike at sentex.net, (http://www.tancsa.com)
More information about the freebsd-hackers