我们其中一个服务器在启动时performance出奇怪的networking性能。 我们一直在使用configuration更改和ifup / ifdown来尝试隔离问题,结果令人沮丧地不一致。 我们有一个configuration与其他服务器一致,我们没有这个问题。 一个显着的区别是,这个服务器来自不同的硬件供应商,但我不知道为什么会导致我们遇到的问题。
当我们用sudo ifup eth0出eth0接口时,会出现bond0.3001接口bond0和vlan接口bond0.3001 ,并且从ifconfig出现正确的configuration,但是默认路由缺失。
user@admin1:~$ route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 10.1.1.0 0.0.0.0 255.255.255.0 U 0 0 0 bond0.3001
反复试图将接口closures(使用sudo ifdown bond0 ,这似乎是一个简单的方法,用一个命令来closures整个多层configuration),然后备份,似乎并没有正确添加路由。 但是,如果我们在接口文件/etc/network/interfaces编辑bond0.3001条目,它会频繁地(但不总是)调出接口,以及正确的默认路由。
user@admin1:~$ route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 0.0.0.0 10.1.1.1 0.0.0.0 UG 0 0 0 bond0.3001 10.1.1.0 0.0.0.0 255.255.255.0 U 0 0 0 bond0.3001
我们一直在评论下面的“networking”线作为文件编辑,结果有些一致; 当我们进行编辑,并popup界面堆栈时,默认路由很常见。 当我们跳过界面堆栈而没有进行编辑时,它似乎100%的时间都失败了。 使用sudo route add default gw 10.1.1.1 bond0.3001 route手动sudo route add default gw 10.1.1.1 bond0.3001每次尝试都有效,但是我们需要系统可靠地重新启动networking。
这是我们的configuration:
user@admin1:~$ cat /etc/network/interfaces # This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). # The loopback network interface auto lo iface lo inet loopback auto eth0 iface eth0 inet manual bond-master bond0 auto eth1 iface eth1 inet manual bond-master bond0 # The primary network interface #Aggregate bond auto bond0 iface bond0 inet manual bond-slaves none bond-mode 802.3ad bond-miimon 100 bond-lacp-rate 1 auto bond0.3001 iface bond0.3001 inet static address 10.1.1.14 gateway 10.1.1.1 netmask 255.255.255.0 #network 10.1.1.0 broadcast 10.1.1.255 #post-up route add default gw 10.1.1.1 bond0.3001 #post-down route del default gw 10.1.1.1 bond0.3001
一个额外的数据点 – 在运行sudo strace -f sudo ifup eth0来尝试查看差异是什么,它会比成功尝试(创build的默认路由)花费更多的时间。 (默认路由丢失)这可能只是其他下游networking服务正在运行,当没有默认路由时,会迅速失败。
编辑:越来越怀疑内核更新是罪魁祸首,更新似乎解决了这个服务器的问题是3.19.0-25至3.19.0-43。 内核更新之后,我们已经在其他服务器上看到类似的行为 对特定的内核版本进行更多的testing可能是追踪根本原因所必需的。
我本周刚刚遇到了一个Ubuntu 14.04.3服务器机箱的问题,全部升级到linux-generic-lts-vivid并运行3.19.0-43内核。 几天之后,我们通过将内核降级到3.16.0-57(我们与14.04.3 amd64服务器iso附带的3.19.0-2x内核有同样的问题)来解决问题。
apt-get remove linux-generic-lts-vivid -y apt-get autoremove apt-get install linux-generic-lts-utopic -y rm -f /boot/*3.19* update-grub reboot
就症状而言,默认路由在启动过程中是非确定性添加的。 我们总是可以通过ifdown bond0 && ifup p4p2 p5p2来修复它,但是和我们一样,我们需要networking在启动时可靠地工作。