NIC Bonding

On my LAN, I have 6T of storage. I've been working on upgrading this to add capacity and improve data duplication for backup purposes. Through the upgrades, I've been introducing disk striping and NIC bonding to improve performance.

All my disks are managed using LVM because this allows me to make multiple physical disks appear as one large storage volume. I use data striping to improve data transfer rates and touched on how to use disk striping with LVM in a previous post. In this post, I'm looking at the performance impact of disk striping and using NIC bonding to improve network performance.

We can measure disk speed using: sudo hdparm -tT [disk device]

So for example, I have an SSD on /dev/sda, and can measure the speed by running sudo hdparm -tT /dev/sda. This finds the disk has a read speed of about 400MB/sec, which is pretty great.

Next I want to measure disk speed of the LVM to see the impact of striping. I have two disks /dev/sdc and /dev/sdd with a logical volume /dev/phil.chasefox.lan/home striped across them. Each disk has about 165MB/sec read speed and the logical volume reads at about 300MB/sec. So disk striping has an awesome impact on disk performance!

My core network switch is unfortunatly not gigabit, but by adding NICs to my PCs, I can bond the interfaces and improve bandwidth between hosts on my LAN. Read this article for more information. Unlike the example in that article, our primary interest is improving performance rather than simply adding fault tolerance, so we want balance-rr mode rather than active-backup.

example /etc/network/interfaces:

auto eth0
iface eth0 inet manual
bond-master bond0
bond-primary eth0

auto eth1
iface eth1 inet manual
bond-master bond0

auto bond0
iface bond0 inet dhcp
bond-mode balance-rr
bond-miimon 100
bond-slaves none

I set up two PCs like this, which meant adding a second NIC to each, and connecting both NICs in each PC to my core LAN switch (four total network connections from two PCs). I like using nload to monitor overall network throughput. Before bonding, I was achieving about 93Mb/s, and after bonding I can achieve about 165Mb/s. It's not a linear improvement, but still very good!

NIC Bonding
Share this