4285ch04.fm Draft Document for Review May 4, 2007 11:35 am
126 Linux Performance and Tuning Guidelines
netstat, tcpdump and ethereal are useful tools to get more accurate characteristics (Refer to
2.3.11, “netstat” on page53 and 2.3.13, “tcpdump / ethereal” on page 55).
4.7.2 Speed and duplexing
It may sound trivial but one of the easiest ways to improve network performance is by
checking the actual speed of the network interface because there can be issues between
network components (such as switches or hubs) and the network interface cards. The
mismatch can have a large performance impact as shown in Example 4-17.
Example 4-17 Using ethtool to check the actual speed an duplex settings
[root@linux ~]# ethtool eth0
Settings for eth0:
Supported ports: [ MII ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Advertised auto-negotiation: Yes
Speed: 100Mb/s
Duplex: Full
From the benchmark results shown in Figure4-15, note that a small data transfer is less
impacted than a larger data transfer when network speeds are incorrectly negotiated.
Especially data transfers larger than 1KB shows the drastic performance impact (throughput
declines 50-90%). Make sure that the speed and duplex are correctly set.
Figure 4-15 Performance degradation caused by auto negotiation failure
Numerous network devices default to 100 Mb half-duplex in case of a minor mismatch during
the auto negotiation process. To check for the actual line speed and duplex setting of a
network connection, use the ethtool command.
Note that most network administrators believe that the best way to attach a network interface
to the network is by specifying static speeds at both the NIC and the switch or hub port. To
100Mbsp half duplex
0.01
0.10
1.00
10.00
100.00
1,000.00
1024 2048 4096 8192 16384 32768 65536 131070 262144
socket sizes
Mbytes/sec
1
16
128
1K
4K
16K
32K
64K
128K
Response
data size
1Gbps full duplex
0.01
0.10
1.00
10.00
100.00
1,000.00
1024 2048 4096 8192 16384 32768 65536 131070 262144
socket size
Mbytes/sec
1
16
128
1K
4K
16K
32K
64K
128K
Response
data size