Troubleshooting slow boot due to network devices

1

I'm trying to troubleshoot boot times for a relatively modern machine with a SSD. The machine runs Ubuntu Server 14.04.3 LTS and it has two ethernet ports. Network Manager is not installed. All device are Gigabit ethernet capable, and Cat6 cabling is used throughout. The cable lengths from the server to the switch are 6 or 10 feet.

When only eth0 was in use with DHCP, the machine would boot in about 2.5 to 3 seconds.

I enabled eth1 and added a br0 to support host-bridging for virtualization. The VMs use the second ethernet interface, and none of the VMs auto-start. Now the boot times are 30 seconds or so.

How do I troubleshoot this?

Or how do I fix it (if it can be determined from the limited information I have)?


/etc/networks/interfaces

Changing the spanning tree protocol state (on or off) makes no difference. Commenting out the bridge drops the boot time to about 5 seconds.

$ cat /etc/network/interfaces
...

# Primary network interface
auto eth0
iface eth0 inet dhcp

# Secondary network interface
iface eth1 inet manual
      pre-up ifconfig $IFACE up
      post-down ifconfig $IFACE down

# Bridged interface for virtualization
auto br0
iface br0 inet dhcp
      bridge_ports eth1
      bridge_stp on
      bridge_fd 0
      bridge_maxwait 0

dmesg output

$ dmesg | egrep -i "(eth|r1869)"
[    1.580017] r8169 Gigabit Ethernet driver 2.3LK-NAPI loaded
[    1.581643] r8169 0000:02:00.0 eth0: RTL8168evl/8111evl at 0xffffc900018fc000, 00:e0:4c:68:03:5e, XID 0c900800 IRQ 46
[    1.582988] r8169 0000:02:00.0 eth0: jumbo features [frames: 9200 bytes, tx checksumming: ko]
[    1.583755] r8169 Gigabit Ethernet driver 2.3LK-NAPI loaded
[    1.585640] r8169 0000:03:00.0 eth1: RTL8168evl/8111evl at 0xffffc90005b98000, 00:e0:4c:68:03:5f, XID 0c900800 IRQ 48
[    1.587100] r8169 0000:03:00.0 eth1: jumbo features [frames: 9200 bytes, tx checksumming: ko]
[    3.086938] r8169 0000:02:00.0 eth0: link down
[    3.086956] r8169 0000:02:00.0 eth0: link down
[    5.463989] r8169 0000:02:00.0 eth0: link up
[    7.138820] device eth1 entered promiscuous mode
[    7.248670] r8169 0000:03:00.0 eth1: link down
[    7.248687] r8169 0000:03:00.0 eth1: link down
[   25.169258] r8169 0000:03:00.0 eth1: link up
[   25.169742] br0: port 1(eth1) entered listening state
[   25.169748] br0: port 1(eth1) entered listening state
[   27.171555] br0: port 1(eth1) entered learning state
[   29.174455] br0: port 1(eth1) entered forwarding state

ethtool

$ sudo ethtool eth0 | egrep -i "(speed|duplex|neg)"
    Speed: 1000Mb/s
    Duplex: Full
    Auto-negotiation: on
$ sudo ethtool eth1 | egrep -i "(speed|duplex|neg)"
    Speed: 100Mb/s
    Duplex: Full
    Auto-negotiation: on

jww

Posted 2016-02-04T07:46:45.133

Reputation: 1

Answers

2

Based on these messages...

[    7.248687] r8169 0000:03:00.0 eth1: link down
[   25.169258] r8169 0000:03:00.0 eth1: link up

...it seems the network card has troubles establishing the physical Ethernet link. Make sure you have a good cable; maybe try swapping eth0 and eth1. Use ethtool eth1 or mii-tool -v eth1 to check what speeds have been negotiated.

user1686

Posted 2016-02-04T07:46:45.133

Reputation: 283 655

*[ 5.463989] r8169 0000:02:00.0 eth0: link up* Probably it is either other end of the cable or cable itself – aaaaa says reinstate Monica – 2016-02-04T08:48:57.153

1Thanks again @grawity. You we right about the cable: with two new Cat6 cables in place, it takes about 11 seconds to boot (down from 25 to 30). 6 seconds of the new boot time appears to be due to the bridge. I'll look at tuning the bridge in another question. – jww – 2016-02-06T20:29:05.737

0

Grawity provided the answer that the cabling was likely a problem. For completeness and reference, here's the new dmesg output.

$ dmesg | egrep -i "(eth|r1869)"
[    1.578910] r8169 Gigabit Ethernet driver 2.3LK-NAPI loaded
[    1.580850] r8169 0000:02:00.0 eth0: RTL8168evl/8111evl at 0xffffc900018fc000, 00:e0:4c:68:03:5e, XID 0c900800 IRQ 46
[    1.580852] r8169 0000:02:00.0 eth0: jumbo features [frames: 9200 bytes, tx checksumming: ko]
[    1.581047] r8169 Gigabit Ethernet driver 2.3LK-NAPI loaded
[    1.581495] r8169 0000:03:00.0 eth1: RTL8168evl/8111evl at 0xffffc90005b98000, 00:e0:4c:68:03:5f, XID 0c900800 IRQ 48
[    1.581496] r8169 0000:03:00.0 eth1: jumbo features [frames: 9200 bytes, tx checksumming: ko]
[    2.847016] r8169 0000:02:00.0 eth0: link down
[    2.847034] r8169 0000:02:00.0 eth0: link down
[    5.169713] r8169 0000:02:00.0 eth0: link up
[   11.065366] device eth1 entered promiscuous mode
[   11.194437] r8169 0000:03:00.0 eth1: link down
[   11.194454] r8169 0000:03:00.0 eth1: link down
[   13.533359] r8169 0000:03:00.0 eth1: link up
[   13.533844] br0: port 1(eth1) entered forwarding state
[   13.533851] br0: port 1(eth1) entered forwarding state

jww

Posted 2016-02-04T07:46:45.133

Reputation: 1