Testing network throughput in Linux

I was at a customer site the other day doing a POC to compare performance between an ODA and an AIX system running Oracle Database.  The network didn’t seem to be very busy at all and I wanted to rule out throughput as a bottleneck for performance issues.  I wound up using nc (netcat) and dd (disk dump) to show the network throughput.  Here’s an example of what I did (on two different systems):

 

System 1:

[root@forge ~]# nc -vl 2222 >/dev/null

System 2:

[root@daryl ~]# dd if=/dev/zero bs=1024k count=256 | nc -v 10.10.155.10 2222
Connection to 10.10.155.10 2222 port [tcp/EtherNet/IP-1] succeeded!
256+0 records in
256+0 records out
268435456 bytes (268 MB) copied, 22.7638 s, 11.8 MB/s

This tells me that one of the two systems is probably connected at 100Mb. Further investigation reveals that I was right:

System 1:

[root@forge ~]# ethtool eth0
Settings for eth0:
        Supported ports: [ TP ]
        Supported link modes:   1000baseT/Full
                                10000baseT/Full
        Supported pause frame use: No
        Supports auto-negotiation: No
        Advertised link modes:  Not reported
        Advertised pause frame use: No
        Advertised auto-negotiation: No
        Speed: 1000Mb/s
        Duplex: Full
        Port: Twisted Pair
        PHYAD: 0
        Transceiver: internal
        Auto-negotiation: off
        MDI-X: Unknown
        Supports Wake-on: uag
        Wake-on: d
        Link detected: yes

System 2:

[root@daryl ~]# ethtool eth0
Settings for eth0:
        Supported ports: [ TP ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Half 1000baseT/Full
        Supported pause frame use: No
        Supports auto-negotiation: Yes
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Half 1000baseT/Full
        Advertised pause frame use: Symmetric
        Advertised auto-negotiation: Yes
        Link partner advertised link modes:  10baseT/Half 10baseT/Full
                                             100baseT/Half 100baseT/Full
        Link partner advertised pause frame use: Symmetric
        Link partner advertised auto-negotiation: Yes
        Speed: 100Mb/s
        Duplex: Full
        Port: Twisted Pair
        PHYAD: 1
        Transceiver: internal
        Auto-negotiation: on
        MDI-X: off
        Supports Wake-on: g
        Wake-on: g
        Current message level: 0x000000ff (255)
                               drv probe link timer ifdown ifup rx_err tx_err
        Link detected: yes

If you look at the output above, you’ll see that the line that starts with “Speed:” shows the currently connected link speed. Sure enough, daryl is stuck at 100Mb so we get the slower speed.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s