知乎專欄 | 多維度架構 |
目錄
數不清的用戶在訪問你的伺服器
頻寬與伺服器可以隨時增加,但也有限
瓶頸無處不在
user -> \ /--1G--> | server | user -> |--1G--> [Firewal] --1G--> [Switch] ----1G--> | server | user -> / \--1G--> | server |
主流網絡設備頻寬均為1G,目前來看10G仍不普及,僅在存儲領域封閉使用,價格非常昂貴
firewall (1G) - switch (Forwarding bandwidth / 1G) - server (NIC 1G)
怎麼能提高頻寬呢?
首先是防火牆,這個設備非常重要。 100M 基本淘汰,10G 防火牆尚未普及,1G頻寬如果不夠怎麼辦?答案是買2個,3個...
為什麼不買10G的。在下面會談到會話數,你一看就明白了。10G防火牆會話數不是1G防火牆會話數的十倍。
目前主流交換機 Cisco WS-C2960G-48TC-L,48個RJ45口與2或4個SFP光纖口均為1G頻寬
一般中小企業1台交換機足夠,再上一個台階超過40台伺服器,就會有出現多台交換機互連問題,使用乙太網口與SFP光纖口的頻寬是一樣的,唯一區別是傳輸距離。
每個交換機後面都對應幾十台伺服器,每個伺服器1G網卡,如果這些伺服器滿負荷傳輸,交換機與交換機間數據傳輸就會帶來瓶頸。
通過連接埠聚合可以解決交換機間數據傳輸瓶頸,另種方式是交換機堆疊。
+----------+ +----------+ | |gi0/0/1 gi0/0/1| | | Switch A +--------------------------+ Switch B | | +--------------------------+ | | |gi0/0/2 gi0/0/2| | +----------+ +----------+
比如你有5個機櫃,將交換機放置到3號機櫃,處于中間位置,所有交換機放入該機櫃,然後堆疊,從中心機櫃向兩側分綫
對於不大不小的企業,直接採購IDC箱式交換機
Example 1 : host to host at double speed +----------+ +----------+ | |eth0 eth0| | | Host A +--------------------------+ Host B | | +--------------------------+ | | |eth1 eth1| | +----------+ +----------+ On each host : # modprobe bonding miimon=100 # ifconfig bond0 addr # ifenslave bond0 eth0 eth1 Example 2 : host to switch at double speed +----------+ +----------+ | |eth0 port1| | | Host A +--------------------------+ switch | | +--------------------------+ | | |eth1 port2| | +----------+ +----------+ On host A : On the switch : # modprobe bonding miimon=100 # set up a trunk on port1 # ifconfig bond0 addr and port2 # ifenslave bond0 eth0 eth1 Example 3: High Availability in a Multiple Switch Topology | | |port3 port3| +-----+----+ +-----+----+ | |port2 ISL port2| | | switch A +--------------------------+ switch B | | | | | +-----+----+ +-----++---+ |port1 port1| | +-------+ | +-------------+ host1 +---------------+ eth0 +-------+ eth1 Example 4: Maximum Throughput in a Multiple Switch Topology Multiple switches may be utilized to optimize for throughput when they are configured in parallel as part of an isolated network between two or more systems, for example: +-----------+ | Host A | +-+---+---+-+ | | | +--------+ | +---------+ | | | +------+---+ +-----+----+ +-----+----+ | Switch A | | Switch B | | Switch C | +------+---+ +-----+----+ +-----+----+ | | | +--------+ | +---------+ | | | +-+---+---+-+ | Host B | +-----------+ Example 5: Using multiple host and multiple switches to build a "no single point of failure" solution. | | |port3 port3| +-----+----+ +-----+----+ | |port7 ISL port7| | | switch A +--------------------------+ switch B | | +--------------------------+ | | |port8 port8| | +----++----+ +-----++---+ port2||port1 port1||port2 || +-------+ || |+-------------+ host1 +---------------+| | eth0 +-------+ eth1 | | | | +-------+ | +--------------+ host2 +----------------+ eth0 +-------+ eth1
目前主流服務都配備2到4個網口,像IBM / HP / DELL 等品牌伺服器你無需關心網卡問題.
這裡主要是針對自行安裝或使用PC伺服器的用戶,因為很多PC伺服器使用Realtak網卡。那麼Realtak與Broadcom的NetXtreme有什麼不同?
建議你安裝一個windows系統在伺服器上,然後看看網卡驅動屬性。Realtak 僅僅提供基本網絡功能,QOS質量訪問服務由驅動程式提供(軟QOS)而NetXtreme 提供非常豐富的功能,並且都是硬件實現。
話題回到頻寬上,linux 支持 bonding 網卡,可以幫你解決伺服器網絡通信頻寬問題,bonding 還可以解決網卡故障轉移,傳輸流量負載均衡等等。
在我的《Netkiller Linux 手札》中你可以找到具體的設置方法。