Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 28 Mar 2008 11:20:12 -0700
From:      Chris <eagletree@hughes.net>
To:        freebsd-net@freebsd.org
Subject:   if_bridge performance issue?
Message-ID:  <921F19D4-0900-4975-B7D9-C0D6BCA1460D@hughes.net>

next in thread | raw e-mail | index | archive | help
Hello,

I was wondering if I'm seeing a normal issue with if_bridge and
having an IP assigned to one of the interfaces within a bridge.
I see a confusing performance problem when attempting to move
data via sftp "to" the machine versus "through" the machine. The
difference is quite pronounced. When I sftp through the bridge
to another FreeBSD machine behind it (A very old and slow
Compaq running FreeBSD 6.2), I get acceptable performance
averaging 1.5MB Per Second. When I send to the IP on the
interface of the bridge (coming in through the same em NIC),
I get ~320KB Per Second. The bridge system uses modern
SATA Drives so I'm pretty sure it's not disk speed slowing the
bridge system.

I've monitored IPFW to try and find a bottleneck in the rules for
the local interface. It turns out it's just the opposite in that when
passing through the system, many additional rules are traversed
while the rules for the local interface immediately are passed on
a dynamic rule. In fact the bridged traffic is passing through
snort_inline via divert, the local interface traffic is not.

I'm not sure I actually care that this performance difference is
occurring since very little traffic will go to the bridge system,
but it does make me wonder if I've done something odd to
cause it. Is there any reason why the local interface on an
if_bridge bridge computer would show worse performance
for the same operations that pass through the bridge to other
systems.

The config is:
Bridge System
FreeBSD 7.0 Release, if_bridge and ipfw compiled into the Kernel
Dual CPU Intel Supermicro with SATA drives
Dual port em NICs (have tried multiples now)

Test Server behind Bridge
FreeBSD 6.2 Release, runs just apache and sshd
900mhz Athlon with IDE Drives
Single port em NIC

Test Client
Dual Macintosh G5 tower running 10.4 OS-X

Results

SFTP to Bridge System
File Size: 46 MB, Duration of transfer: ~2.25 Minutes, Reported  
Performance: 324KBPS

SFTP to Test Server
File Size: 46 MB, Duration of transfer: ~34 Seconds, Reported  
Performance: 1.4MBPS

rc.conf relevant entries:

ifconfig_em1="inet 192.168.0.221  netmask 255.255.255.0 media  
100baseTX mediaopt full-duplex polling"
ifconfig_em0="media 100baseTX mediaopt full-duplex polling"
# em0 LAN, em1 T1 WAN
cloned_interfaces="bridge0"
ifconfig_bridge0="addm em0 up addm em1 up"

(note, both tests are incoming through em1.)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?921F19D4-0900-4975-B7D9-C0D6BCA1460D>