Friday, June 30, 2006

Poor network performance? Check the duplex dude

Force gigE NICs to operate at 100baseTX-FD.

Let's say you are getting poor network performance on your Linux box. You check the result of /sbin/ifconfig and notice quite a few collisions. Not only that, but anytime you transfer a bunch of packets, you generate more collisions.

Turns out, it may be that your ethernet device did not autonegotiate correctly. In my case, when I ran /sbin/ethtool eth0 I got:

Settings for eth0:
        Supported ports: [ TP ]
        Supported link modes:   10baseT/Half 10baseT/Full 
                                100baseT/Half 100baseT/Full 
                                1000baseT/Full 
        Supports auto-negotiation: Yes
        Advertised link modes:  Not reported
        Advertised auto-negotiation: No
        Speed: 100Mb/s
        Duplex: Half
        Port: Twisted Pair
        PHYAD: 0
        Transceiver: internal
        Auto-negotiation: off
        Supports Wake-on: umbg
        Wake-on: g
        Current message level: 0x00000007 (7)
        Link detected: yes

My network should have been talking Full duplex.

I simply crossed my fingers and ran the command:

 sudo /sbin/ethtool -s eth0 duplex full speed 100 autoneg off

This set things straight between my ethernet card and the network.

As the article I link suggests, you can do:

To select
 autonegotiation = off
 speed = 100Mbps
 duplex = full
add a line to /etc/sysconfig/network-scripts/eth0 saying
 ETHTOOL_OPTS=autoneg off speed 100 duplex full

No comments:

Post a Comment