Linux網路卡繫結實現頻寬翻倍
之前有過一篇BLOG,是介紹如何簡單的將Linux兩張網路卡進行繫結,已實現高可用。但在之前的模式裡,僅僅能實現高可用,當兩個網路卡中的一個失效時並不會影響伺服器的聯通性。
但是,如果有交換機的配合,是否可以時間負載均衡,同時達到頻寬翻倍的目的呢?
首先,需要先明確,繫結的各種模式
0 - Sets a round-robin policy for fault tolerance and load balancing. Transmissions are received and sent out sequentially on each bonded slave interface beginning with the first one available.
1 - Sets an active-backup policy for fault tolerance. Transmissions are received and sent out via the first available bonded slave interface. Another bonded slave interface is only used if the active bonded slave interface fails.
2 - Sets an XOR (exclusive-or) policy for fault tolerance and load balancing. Using this method, the interface matches up the incoming request's MAC address with the MAC address for one of the slave NICs. Once this link is established, transmissions are sent out sequentially beginning with the first available interface.
3 - Sets a broadcast policy for fault tolerance. All transmissions are sent on all slave interfaces.
4 - Sets an IEEE 802.3ad dynamic link aggregation policy. Creates aggregation groups that share the same speed and duplex settings. Transmits and receives on all slaves in the active aggregator. Requires a switch that is 802.3ad compliant.
5 - Sets a Transmit Load Balancing (TLB) policy for fault tolerance and load balancing. The outgoing traffic is distributed according to the current load on each slave interface. Incoming traffic is received by the current slave. If the receiving slave fails, another slave takes over the MAC address of the failed slave.
6 - Sets an Active Load Balancing (ALB) policy for fault tolerance and load balancing. Includes transmit and receive load balancing for IPV4 traffic. Receive load balancing is achieved through ARP negotiation.
需要注意的是MODE 0僅僅能實現網路卡輪詢,但同一時間只有一個網路卡生效,總體頻寬還是1個網路卡的頻寬。
這裡,我們需要開啟交換機的802.3ad,並設定mode=4來實現頻寬增倍
具體測試方法參見:
http://sundog315.itpub.net/post/308/525631
注意,在上面這個BLOG裡的mode需要改一下:
vi /etc/modprobe.conf
alias bond0 bonding
options bond0 miimon=100 mode=4 lacp_rate=1
我們用iperf工具來測試頻寬,由於mode 4模式使用mac地址分配那個網路卡參與工作,因此,需要多臺測試機進行測試
10.199.81.39作為server,10.199.81.40及10.199.81.42作為client,如果兩個client均能達到1000Mbits,那也就意味著頻寬是翻倍了。
server:
# iperf -s -w 1M
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 2.00 MByte (WARNING: requested 1.00 MByte)
------------------------------------------------------------
[ 4] local 10.199.81.39 port 5001 connected with 10.199.81.40 port 9951
[ 5] local 10.199.81.39 port 5001 connected with 10.199.81.42 port 61211
[ ID] Interval Transfer Bandwidth
[ 4] 0.0-100.0 sec 11.1 GBytes 949 Mbits/sec
[ 5] 0.0-100.0 sec 11.1 GBytes 949 Mbits/sec
達到了頻寬翻倍的目的
[@more@]# iperf -c 10.199.81.39 -w 1M -t 100 -i 2
------------------------------------------------------------
Client connecting to 10.199.81.39, TCP port 5001
TCP window size: 2.00 MByte (WARNING: requested 1.00 MByte)
------------------------------------------------------------
[ 3] local 10.199.81.40 port 9951 connected with 10.199.81.39 port 5001
[ ID] Interval Transfer Bandwidth
[ 3] 0.0- 2.0 sec 228 MBytes 956 Mbits/sec
[ 3] 2.0- 4.0 sec 226 MBytes 949 Mbits/sec
[ 3] 4.0- 6.0 sec 226 MBytes 948 Mbits/sec
[ 3] 6.0- 8.0 sec 227 MBytes 952 Mbits/sec
[ 3] 8.0-10.0 sec 226 MBytes 948 Mbits/sec
[ 3] 10.0-12.0 sec 226 MBytes 949 Mbits/sec
[ 3] 12.0-14.0 sec 226 MBytes 948 Mbits/sec
[ 3] 14.0-16.0 sec 226 MBytes 948 Mbits/sec
[ 3] 16.0-18.0 sec 227 MBytes 952 Mbits/sec
[ 3] 18.0-20.0 sec 226 MBytes 948 Mbits/sec
[ 3] 20.0-22.0 sec 226 MBytes 948 Mbits/sec
[ 3] 22.0-24.0 sec 227 MBytes 951 Mbits/sec
[ 3] 24.0-26.0 sec 226 MBytes 949 Mbits/sec
[ 3] 26.0-28.0 sec 226 MBytes 948 Mbits/sec
[ 3] 28.0-30.0 sec 226 MBytes 949 Mbits/sec
[ 3] 30.0-32.0 sec 226 MBytes 948 Mbits/sec
[ 3] 32.0-34.0 sec 227 MBytes 951 Mbits/sec
[ 3] 34.0-36.0 sec 226 MBytes 948 Mbits/sec
[ 3] 36.0-38.0 sec 226 MBytes 949 Mbits/sec
[ 3] 38.0-40.0 sec 226 MBytes 948 Mbits/sec
[ 3] 40.0-42.0 sec 227 MBytes 952 Mbits/sec
[ 3] 42.0-44.0 sec 226 MBytes 948 Mbits/sec
[ 3] 44.0-46.0 sec 226 MBytes 949 Mbits/sec
[ 3] 46.0-48.0 sec 226 MBytes 948 Mbits/sec
[ 3] 48.0-50.0 sec 226 MBytes 949 Mbits/sec
[ 3] 50.0-52.0 sec 227 MBytes 952 Mbits/sec
[ 3] 52.0-54.0 sec 226 MBytes 949 Mbits/sec
[ 3] 54.0-56.0 sec 226 MBytes 948 Mbits/sec
[ 3] 56.0-58.0 sec 226 MBytes 949 Mbits/sec
[ 3] 58.0-60.0 sec 226 MBytes 948 Mbits/sec
[ 3] 60.0-62.0 sec 227 MBytes 952 Mbits/sec
[ 3] 62.0-64.0 sec 226 MBytes 948 Mbits/sec
[ 3] 64.0-66.0 sec 226 MBytes 948 Mbits/sec
[ 3] 66.0-68.0 sec 226 MBytes 948 Mbits/sec
[ 3] 68.0-70.0 sec 226 MBytes 949 Mbits/sec
[ 3] 70.0-72.0 sec 227 MBytes 952 Mbits/sec
[ 3] 72.0-74.0 sec 226 MBytes 948 Mbits/sec
[ 3] 74.0-76.0 sec 226 MBytes 949 Mbits/sec
[ 3] 76.0-78.0 sec 226 MBytes 948 Mbits/sec
[ 3] 78.0-80.0 sec 226 MBytes 948 Mbits/sec
[ 3] 80.0-82.0 sec 227 MBytes 952 Mbits/sec
[ 3] 82.0-84.0 sec 226 MBytes 949 Mbits/sec
[ 3] 84.0-86.0 sec 226 MBytes 948 Mbits/sec
[ 3] 86.0-88.0 sec 226 MBytes 948 Mbits/sec
[ 3] 88.0-90.0 sec 226 MBytes 949 Mbits/sec
[ 3] 90.0-92.0 sec 227 MBytes 952 Mbits/sec
[ 3] 92.0-94.0 sec 226 MBytes 948 Mbits/sec
[ 3] 94.0-96.0 sec 226 MBytes 948 Mbits/sec
[ 3] 96.0-98.0 sec 226 MBytes 949 Mbits/sec
[ 3] 98.0-100.0 sec 227 MBytes 952 Mbits/sec
[ 3] 0.0-100.0 sec 11.1 GBytes 949 Mbits/sec
# iperf -c 10.199.81.39 -w 1M -t 100 -i 2
------------------------------------------------------------
Client connecting to 10.199.81.39, TCP port 5001
TCP window size: 2.00 MByte (WARNING: requested 1.00 MByte)
------------------------------------------------------------
[ 3] local 10.199.81.42 port 61211 connected with 10.199.81.39 port 5001
[ ID] Interval Transfer Bandwidth
[ 3] 0.0- 2.0 sec 228 MBytes 956 Mbits/sec
[ 3] 2.0- 4.0 sec 226 MBytes 949 Mbits/sec
[ 3] 4.0- 6.0 sec 226 MBytes 948 Mbits/sec
[ 3] 6.0- 8.0 sec 226 MBytes 948 Mbits/sec
[ 3] 8.0-10.0 sec 227 MBytes 952 Mbits/sec
[ 3] 10.0-12.0 sec 226 MBytes 949 Mbits/sec
[ 3] 12.0-14.0 sec 226 MBytes 948 Mbits/sec
[ 3] 14.0-16.0 sec 226 MBytes 949 Mbits/sec
[ 3] 16.0-18.0 sec 226 MBytes 948 Mbits/sec
[ 3] 18.0-20.0 sec 226 MBytes 949 Mbits/sec
[ 3] 20.0-22.0 sec 227 MBytes 952 Mbits/sec
[ 3] 22.0-24.0 sec 226 MBytes 948 Mbits/sec
[ 3] 24.0-26.0 sec 226 MBytes 948 Mbits/sec
[ 3] 26.0-28.0 sec 226 MBytes 948 Mbits/sec
[ 3] 28.0-30.0 sec 227 MBytes 952 Mbits/sec
[ 3] 30.0-32.0 sec 226 MBytes 948 Mbits/sec
[ 3] 32.0-34.0 sec 226 MBytes 948 Mbits/sec
[ 3] 34.0-36.0 sec 226 MBytes 948 Mbits/sec
[ 3] 36.0-38.0 sec 227 MBytes 952 Mbits/sec
[ 3] 38.0-40.0 sec 226 MBytes 948 Mbits/sec
[ 3] 40.0-42.0 sec 226 MBytes 949 Mbits/sec
[ 3] 42.0-44.0 sec 226 MBytes 948 Mbits/sec
[ 3] 44.0-46.0 sec 226 MBytes 949 Mbits/sec
[ 3] 46.0-48.0 sec 227 MBytes 951 Mbits/sec
[ 3] 48.0-50.0 sec 226 MBytes 948 Mbits/sec
[ 3] 50.0-52.0 sec 226 MBytes 949 Mbits/sec
[ 3] 52.0-54.0 sec 226 MBytes 948 Mbits/sec
[ 3] 54.0-56.0 sec 227 MBytes 951 Mbits/sec
[ 3] 56.0-58.0 sec 226 MBytes 948 Mbits/sec
[ 3] 58.0-60.0 sec 226 MBytes 948 Mbits/sec
[ 3] 60.0-62.0 sec 227 MBytes 952 Mbits/sec
[ 3] 62.0-64.0 sec 226 MBytes 948 Mbits/sec
[ 3] 64.0-66.0 sec 226 MBytes 948 Mbits/sec
[ 3] 66.0-68.0 sec 226 MBytes 948 Mbits/sec
[ 3] 68.0-70.0 sec 226 MBytes 949 Mbits/sec
[ 3] 70.0-72.0 sec 227 MBytes 952 Mbits/sec
[ 3] 72.0-74.0 sec 226 MBytes 948 Mbits/sec
[ 3] 74.0-76.0 sec 226 MBytes 948 Mbits/sec
[ 3] 76.0-78.0 sec 226 MBytes 949 Mbits/sec
[ 3] 78.0-80.0 sec 226 MBytes 949 Mbits/sec
[ 3] 80.0-82.0 sec 227 MBytes 951 Mbits/sec
[ 3] 82.0-84.0 sec 226 MBytes 948 Mbits/sec
[ 3] 84.0-86.0 sec 226 MBytes 949 Mbits/sec
[ 3] 86.0-88.0 sec 227 MBytes 951 Mbits/sec
[ 3] 88.0-90.0 sec 226 MBytes 949 Mbits/sec
[ 3] 90.0-92.0 sec 226 MBytes 948 Mbits/sec
[ 3] 92.0-94.0 sec 226 MBytes 949 Mbits/sec
[ 3] 94.0-96.0 sec 226 MBytes 948 Mbits/sec
[ 3] 96.0-98.0 sec 227 MBytes 951 Mbits/sec
[ 3] 98.0-100.0 sec 226 MBytes 948 Mbits/sec
[ 3] 0.0-100.0 sec 11.1 GBytes 949 Mbits/sec
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/19423/viewspace-1057750/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- linux 網路卡繫結Linux
- Linux網路卡繫結Linux
- Linux(09):網路卡繫結Linux
- linux下打滿網路卡的頻寬和影響打滿網路卡的原因Linux
- win10 如何檢視網路卡頻寬_win10電腦網路卡頻寬怎麼看Win10
- Linux雙網路卡繫結單個IP之(team)Linux
- 剖析網路卡繫結模式模式
- 頻寬最佳化新思路:RoCE網路卡聚合實現X2增長
- 深度分析Linux下雙網路卡繫結七種模式 多網路卡的7種bond模式原理Linux模式
- Oracle 11gR2 RAC 單網路卡轉雙網路卡繫結配置Oracle
- 頻寬是什麼意思 頻寬和寬頻網速有什麼區別關係
- 千兆寬頻實際網速能到達多少?
- 嵌入式linux裝置網口頻寬-測試方法Linux
- Linux伺服器---ftp限制頻寬Linux伺服器FTP
- 如何使用nload實時監控網路頻寬
- 怎麼區分伺服器頻寬和家用網路寬頻?伺服器
- JS 檢測網路頻寬JS
- Vue雙向繫結實現Vue
- 頻寬
- 在CentOS中用Linux命令列測試網速/頻寬安裝CentOSLinux命令列
- CentOS 應該使用哪些Linux命令列測試網速/頻寬?CentOSLinux命令列
- 西電校園網基於 PPPoE+DHCP 方式實現頻寬疊加
- 虛擬網路卡介面VETH(Virtual Ethernet )建立使用和繫結關係
- 基於nodejs的阿里雲DDNS服務,支援多網路卡繫結NodeJS阿里DNS
- 寬頻發展聯盟:2018年Q3寬頻網速報告
- @ConfigurationProperties實現自定義配置繫結
- vue實現prop雙向繫結Vue
- Linux系統自定義網路卡並更改網路卡介面Linux
- IIS中配置實現網站二級域名繫結方式整理網站
- Mac Linux 重啟網路卡MacLinux
- Linux 7 配置網路卡(nmcli)Linux
- Linux修改網路卡的名字Linux
- LINUX下手工新增網路卡Linux
- Linux Ubuntu 修改網路卡名字LinuxUbuntu
- 簡要實現vue雙向繫結Vue
- 雙向資料繫結實現原理
- angular雙向繫結簡單實現Angular
- 雙向繫結的極簡實現
- javascript實現雙向資料繫結JavaScript