管理 SMB 多重通道Manage SMB Multichannel

適用于: Azure Stack HCI、版本 20H2;Windows Server 2019;Windows Server 2016;Windows Server 2012 R2;Windows Server 2012;Windows 10Applies to: Azure Stack HCI, version 20H2; Windows Server 2019; Windows Server 2016; Windows Server 2012 R2; Windows Server 2012; Windows 10

SMB 多重通道是伺服器訊息區的一部分, (SMB) 3.0 通訊協定,可提高網路效能以及檔案伺服器的可用性。SMB Multichannel is part of the Server Message Block (SMB) 3.0 protocol, which increases network performance and the availability of file servers.

SMB 多重通道可讓檔案伺服器同時使用多個網路連接。SMB Multichannel enables file servers to use multiple network connections simultaneously. 當 SMB 3.0 用戶端和 SMB 3.0 伺服器之間有多個路徑可用時,它可協助匯總網路頻寬和網路容錯。It facilitates aggregation of network bandwidth and network fault tolerance when multiple paths are available between the SMB 3.0 client and the SMB 3.0 server. 這可讓伺服器應用程式充分利用所有可用的網路頻寬,並使其更能在網路失敗時更具彈性。This allows server applications to take full advantage of all available network bandwidth and makes them more resilient to network failures.

SMB 多重通道提供下列功能:SMB Multichannel provides the following capabilities:

  • 提高輸送量。Increased throughput. 檔案伺服器可以透過使用高速網路介面卡或多張網路介面卡的多個連接,同時傳輸額外的資料。The file server can simultaneously transmit additional data by using multiple connections for high-speed network adapters or multiple network adapters.

  • 網路容錯。Network fault tolerance. 當用戶端同時使用多個網路連線時,即使網路連線中斷,用戶端仍可繼續使用,而不會中斷。When clients simultaneously use multiple network connections, the clients can continue without interruption despite the loss of a network connection.

  • 自動設定。Automatic configuration. SMB 多重通道會自動探索多個可用的網路路徑,並視需要動態新增連接。SMB Multichannel automatically discovers multiple available network paths and dynamically adds connections as necessary.

SMB 多重通道的需求Requirements for SMB Multichannel

由於預設會啟用 SMB 多重通道,因此您不需要安裝其他角色、角色服務或功能。Because SMB Multichannel is enabled by default, you do not have to install additional roles, role services, or features. SMB 用戶端會在識別設定時自動偵測並使用多個網路連線。The SMB client automatically detects and uses multiple network connections when the configuration is identified. 不過,SMB 多重通道有下列需求:However, SMB Multichannel has the following requirements:

  • 至少兩部執行 Azure Stack HCI、Windows Server 或 Windows 10 作業系統的電腦。At least two computers that run Azure Stack HCI, Windows Server, or Windows 10 operating system.

  • 至少下列其中一項設定:At least one of the following configurations:

    • 多個網路介面卡Multiple network adapters

    • 一或多個支援接收端調整 (RSS 的網路介面卡) One or more network adapters that support Receive Side Scaling (RSS)

    • 多張組合 (的網路介面卡,請參閱 NIC 小組) Multiple network adapters that are teamed (see NIC teaming)

    • 一或多個支援遠端直接記憶體存取 (RDMA 的網路介面卡) One or more network adapters that support remote direct memory access (RDMA)

設定 SMB 多重通道Configure SMB Multichannel

本節說明使用網路介面卡陣列部署 SMB 多重通道的一些設定選項。This section describes some configuration options for deploying SMB Multichannel using an array of network adapters. 這些設定只是範例設定。These configurations are only example configurations. 本主題中未包含許多其他可能的設定。There are many other possible configurations that are not included in this topic.

支援單一 RSS 的網路介面卡Single RSS-capable network adapter

在這個典型的設定中,SMB 用戶端和 SMB 伺服器是使用單一 10 gigabit Ethernet (10 GbE) 網路介面卡來設定。In this typical configuration, an SMB client and an SMB server are configured by using a single 10-gigabit Ethernet (10 GbE) network adapter. 如果部署 SMB 時沒有 SMB 多重通道,而且只有一個 SMB 會話已建立,則 SMB 會建立單一 TCP/IP 連接。When SMB is deployed without SMB Multichannel, and if there is only one SMB session established, SMB creates a single TCP/IP connection. 在只有單一 CPU 核心的情況下,此設定本身會導致擁塞,尤其是在執行許多小型 i/o 作業時。With only a single CPU core, this configuration inherently leads to congestion, especially when many small I/O operations are performed. 因此,效能瓶頸的潛能相當重要。Therefore, the potential for a performance bottleneck is significant.

大多數目前的網路介面卡都提供稱為「接收端調整」 (RSS) 的功能,可讓多個連接自動分散到多個 CPU 核心。Most current network adapters offer a capability called Receive Side Scaling (RSS), which enables multiple connections to automatically spread across multiple CPU cores. 但是,如果您使用單一連線,RSS 將無法提供協助。However, if you use a single connection, RSS cannot help. 當您使用 SMB 多重通道搭配支援 RSS 的網路介面卡時,SMB 會為該特定會話建立多個 TCP/IP 連接。When you use SMB Multichannel with a RSS-capable network adapter, SMB creates multiple TCP/IP connections for that particular session. 如果需要多個小型 i/o 作業,此設定可避免單一 CPU 核心的潛在瓶頸。This configuration avoids a potential bottleneck on a single CPU core if many small I/O operations are required.

多個網路介面卡Multiple network adapters

在此設定中,SMB 用戶端和 SMB 伺服器是使用多個 10 GbE 網路介面卡來設定。In this configuration, an SMB client and SMB server are configured by using multiple 10 GbE network adapters. 如果部署 SMB 時沒有 SMB 多重通道,而且只有一個 SMB 會話已建立,SMB 會使用其中一個可用的網路介面卡來建立單一 TCP/IP 連接。When SMB is deployed without SMB Multichannel, and if there is only one SMB session established, SMB uses one of the available network adapters to create a single TCP/IP connection. 在此情況下,不可能匯總多個網路介面卡的頻寬;例如,當您使用 2 1-GbE 網路介面卡時,不能達到每秒 2 gb (Gbps) 。In this scenario, it is not possible to aggregate the bandwidth of the multiple network adapters; for example, you cannot achieve 2 gigabits per second (Gbps) when you use two 1-GbE network adapters. 如果選取的網路介面卡已中斷連線或停用,也可能會發生失敗。There is also a potential for failure if the selected network adapter is disconnected or disabled.

使用 SMB 多重通道部署 SMB 時,如果網路介面卡支援 RSS,則 SMB 會為單一會話建立多個 TCP/IP 連線,而且每個介面至少有一個或多個連線。When SMB is deployed with SMB Multichannel, SMB creates multiple TCP/IP connections for a single session with at least one or more connections per interface if the network adapters are RSS-capable. 這項設定可讓 SMB 使用可用的結合網路介面卡頻寬,讓 SMB 用戶端在網路介面卡失敗時仍能繼續進行,而不會中斷。This configuration enables SMB to use the combined network adapter bandwidth that is available and makes it possible for the SMB client to continue without interruption if a network adapter fails.

NIC TeamingNIC teaming

Azure Stack HCI 和 Windows Server 支援使用稱為 NIC 小組的功能,將多張網路介面卡合併成一個網路介面卡的能力。Azure Stack HCI and Windows Server support the ability to combine multiple network adapters into one network adapter by using a feature called NIC teaming. 雖然小組一律會提供容錯功能,但在部署 SMB 時若沒有 SMB 多重通道,SMB 就只會為每個小組建立一個 TCP/IP 連線。Although a team always provides fault tolerance, when SMB is deployed without SMB Multichannel, SMB creates only one TCP/IP connection per team. 這項設定會導致參與的 CPU 核心數目和團隊頻寬的最大使用量有所限制。This configuration leads to limitations in both the number of CPU cores that are engaged and the maximum use of the team bandwidth.

使用 SMB 多重通道部署 SMB 時,SMB 會為單一會話建立多個 TCP/IP 連線,以在 CPU 核心間達到更佳的平衡,並更有效地使用可用的頻寬。When SMB is deployed with SMB Multichannel, SMB creates multiple TCP/IP connections for a single session to achieve a better balance across CPU cores and better use of the available bandwidth. NIC 小組繼續提供容錯移轉功能,其運作速度會比使用 SMB 多重通道本身更快。NIC teaming continues to offer the failover capability, which works faster than using SMB Multichannel by itself. 我們也建議 NIC 小組,因為它會提供容錯移轉功能給其他不依賴 SMB 的工作負載,因為這些工作負載無法受益于 SMB 多重通道的容錯移轉功能。We also recommend NIC teaming because it offers failover capabilities to other workloads that do not rely on SMB, because those workloads cannot benefit from the failover capabilities of SMB Multichannel.

如果您使用一組專用的網路介面卡來儲存空間直接存取流量,有時會使用 Azure Stack HCI 來分組這些儲存體網路介面卡,這並不提供任何顯著的優點或缺點。If you’re using a dedicated set of network adapters for Storage Spaces Direct traffic, as is sometimes done with Azure Stack HCI, teaming these storage network adapters is strictly optional—it doesn’t provide any significant benefits or drawbacks.

重要

在 Windows Server 2012 R2 和更早版本中,如果您想要使用網路介面卡的 RDMA 功能,請勿使用 NIC 小組。On Windows Server 2012 R2 and earlier, do not use NIC teaming if you intend to use the RDMA capabilities of the network adapters. 在這些作業系統上,支援 RDMA 的網路介面卡小組一律會回報為非 RDMA,因為小組會停用網路介面卡的 RDMA 功能。On these operating systems, a team of RDMA-capable network adapters is always reported as non-RDMA capable because teaming disables the RDMA capability of the network adapter.

單一或多個支援 RDMA 的網路介面卡Single or multiple RDMA-capable network adapters

SMB 多重通道會偵測網路介面卡的 RDMA 功能,此功能可讓 SMB 直接功能(稱為 SMB 直接透過 RDMA)進行。SMB Multichannel detects the RDMA capabilities of network adapters, which enables the SMB Direct feature called SMB Direct over RDMA. 如果沒有 SMB 多重通道,SMB 會搭配支援 RDMA 的網路介面卡使用一般 TCP/IP 連線,其中所有網路介面卡都會提供與新 RDMA 堆疊並存存在的 TCP/IP 堆疊。Without SMB Multichannel, SMB uses regular TCP/IP connections with the RDMA-capable network adapters where all network adapters provide a TCP/IP stack that exists side-by-side with the new RDMA stack.

使用 SMB 多重通道部署 SMB 時,SMB 會偵測網路介面卡的 RDMA 功能,並為該單一會話建立多個 RDMA 連線,每個介面都有兩個 RDMA 連接。When SMB is deployed with SMB Multichannel, SMB detects the RDMA capability of a network adapter and creates multiple RDMA connections for that single session, with two RDMA connections per interface. 這項設定可讓 SMB 利用支援 RDMA 的網路介面卡所提供的高輸送量、低延遲和低 CPU 使用率。This configuration enables SMB to take advantage of the high throughput, low latency, and low CPU utilization that is offered by the RDMA-capable network adapters. 當您使用多個 RDMA 介面時,它也會提供容錯能力。It also offers fault tolerance when you use multiple RDMA interfaces.

重要

建立 RDMA 連接之後,就不會再使用原始通訊協定協商的 TCP/IP 連接。After an RDMA connection is created, the TCP/IP connection for the original protocol negotiation is no longer used. 但是,如果有不同的 RDMA 連接失敗,就會維持該連接。However, that connection is maintained in case a different RDMA connection fails.

SMB 多重通道、支援 RDMA 的網路介面卡和 NIC 小組相容性SMB Multichannel, RDMA-capable network adapters, and NIC teaming compatibility

下表摘要說明當您合併 SMB 多重通道、RDMA (SMB Direct) 和 NIC 小組時,可用的不同功能。The following table summarizes the different capabilities that are available when you combine SMB Multichannel, RDMA (SMB Direct), and NIC teaming.

組態Configuration ThroughputThroughput 適用于 SMB 的容錯Fault tolerance for SMB 非 SMB 的容錯Fault tolerance for non-SMB CPU 使用率較低Lower CPU utilization
單一網路介面卡 (沒有 RSS) Single network adapter (no RSS) *
多個網路介面卡 (沒有 RSS) Multiple network adapters (no RSS) ** *
多個網路介面卡 (沒有任何與 NIC 小組的 RSS) Multiple network adapters (no RSS) with NIC teaming ** ** *
具有 RSS 的單一網路介面卡Single network adapter with RSS *
具有 RSS 的多張網路介面卡Multiple network adapters with RSS ** *
具有 RSS 和 NIC 小組的多張網路介面卡Multiple network adapters with RSS and NIC teaming ** ** *
支援單一 RDMA 的網路介面卡Single RDMA-capable network adapter * *
多個支援 RDMA 的網路介面卡Multiple RDMA-capable network adapters *** * *
具有 NIC 小組的多個支援 RDMA 的網路介面卡Multiple RDMA-capable network adapters with NIC teaming *** ** * *

如果您執行的是 Windows Server 2016 或更新版本,理想的解決方案是使用多個支援 RDMA 的網路介面卡,並結合 NIC 小組與 SMB 多重通道。If you're running Windows Server 2016 or later, the ideal solution is to use multiple RDMA-capable network adapters and combine NIC teaming with SMB Multichannel. 這種組合可提供最佳的輸送量、為使用 SMB 和其他通訊協定的應用程式提供容錯功能,並對 CPU 造成最低的影響。This combination provides the best throughput, provides fault tolerance for applications that use SMB and other protocols, and has the lowest CPU impact.

如上所述,在 Windows Server 2012 R2 或更早版本上使用支援 RDMA 的網路介面卡時,NIC 小組並不是不錯的選擇,因為它會停用網路介面卡的 RDMA 功能。As mentioned above, when using RDMA-capable network adapters on Windows Server 2012 R2 or earlier, NIC teaming is not a good option, because it disables the RDMA capability of the network adapter.

沒有 SMB 多重通道的範例設定Example configurations without SMB Multichannel

如果您打算使用沒有 RSS 的單一網路介面卡,您就不會受益于多個網路連線,因此不會使用 SMB 多重通道。If you plan to use a single network adapter without RSS, you do not benefit from multiple network connections, and therefore, SMB Multichannel is not used. 此外,如果您打算使用不同速度的網路介面卡,SMB 多重通道會自動選取最快的網路介面卡。Also, if you plan to use network adapters of different speeds, SMB Multichannel automatically selects the fastest network adapter. 這是因為相同類型 (的網路介面卡,例如 RDMA、RSS 或不) ,而且 SMB 多重通道同時使用相同的速度。This is because network adapters that are the same type (such as RDMA, RSS, or neither) and have the same speed are simultaneously used by SMB Multichannel. 較慢的網路介面卡閒置中。The slower network adapters are idle.

停用 SMB 多重通道Disable SMB Multichannel

一般來說,您不需要停用 SMB 多重通道。Typically, you don't need to disable SMB Multichannel. 但是,如果您想要停用 SMB 多重通道(例如在測試環境中),請使用下列 Windows PowerShell 程式。However, if you want to disable SMB Multichannel, for example in a test environment, use the following Windows PowerShell procedures.

首先,開啟 PowerShell 會話以連接到其中一部伺服器:First, connect to one of the servers by opening a PowerShell session:

Enter-PSSession <server-name>

若要在伺服器端停用 SMB 多重通道,請使用下列 Cmdlet:To disable SMB Multichannel on the server side, use the following cmdlet:

Set-SmbServerConfiguration -EnableMultiChannel $false

若要在用戶端上停用 SMB 多重通道,請使用下列 Cmdlet:To disable SMB Multichannel on the client side, use the following cmdlet:

Set-SmbClientConfiguration -EnableMultiChannel $false

注意

在用戶端或伺服器上停用 SMB 多重通道會封鎖這兩個系統使用它。Disabling SMB Multichannel on either the client or the server blocks both systems from using it.

重新啟用 SMB 多重通道Re-enable SMB Multichannel

如果您已停用 SMB 多重通道,而且想要重新啟用它,請使用下列程式。If you have disabled SMB Multichannel and want to re-enable it, use the following procedures.

若要在伺服器端重新啟用 SMB 多重通道,請使用下列 Cmdlet:To re-enable SMB Multichannel on the server side, use the following cmdlet:

Set-SmbServerConfiguration -EnableMultiChannel $true

若要在用戶端上重新啟用 SMB 多重通道,請使用下列 Cmdlet:To re-enable SMB Multichannel on the client side, use the following cmdlet:

Set-SmbClientConfiguration -EnableMultiChannel $true

注意

您必須在用戶端和伺服器上重新啟用 SMB 多重通道,才能再次開始使用。You must re-enable SMB Multichannel on both the client and the server to start using it again.

測試 SMB 多重通道Test SMB Multichannel

本節說明一些用於測試 SMB 多重通道的案例,包括比較檔案複製與,然後不使用 SMB 多重通道,以及刻意導致網路介面卡在檔案複製作業期間發生失敗。This section describes some scenarios for testing SMB Multichannel, which includes comparing a file copy with and then without SMB Multichannel and intentionally causing a network adapter to fail during a file copy operation.

比較檔案複製與與不含 SMB 多重通道Compare a file copy with and without SMB Multichannel

若要測量 SMB 多重通道所提供的增加輸送量,請執行下列測試。To measure the increased throughput that is provided by SMB Multichannel, perform the following tests. 在每次測試之前重新開機伺服器和用戶端,以確保它們在類似的情況下運作。Restart both the server and the client before each test to make sure that they operate under similar conditions.

  1. 使用先前所述的設定來設定 SMB 多重通道。Configure SMB Multichannel using one the previously described configurations.

  2. 使用 SMB 多重通道測量執行長時間執行之檔案複製作業所需的時間量。Measure the amount of time that it takes to perform a long-running file copy operation by using SMB Multichannel.

  3. 停用 SMB 多重通道。Disable SMB Multichannel. 如需相關指示,請參閱 停用 SMB 多重通道。For instructions, see Disable SMB Multichannel.

  4. 測量執行相同檔案複製而沒有 SMB 多重通道所需的時間量。Measure the amount of time that it takes to perform the same file copy without SMB Multichannel.

  5. 重新啟用 SMB 多重通道。Re-enable SMB Multichannel. 如需相關指示,請參閱 重新啟用 SMB 多重通道。For instructions, see Re-enable SMB Multichannel.

  6. 比較這兩個結果。Compare the two results.

重要

若要避免快取的效能影響,請先複製數量超過可用記憶體大小的大量資料。To avoid the performance impact of caching, first copy a large amount of data that exceeds the size of available memory. 然後再次執行複製作業,並將第一個複製作業做為準備工作。Then perform the copy operation again, with the first copy operation serving as a warm-up. 只有第二個複製作業的時間。Time only the second copy operation.

使其中一個網路介面卡在使用 SMB 多重通道的檔案複製期間失敗Cause one of the network adapters to fail during a file copy with SMB Multichannel

若要確認 SMB 多重通道的容錯移轉功能:To confirm the failover capability of SMB Multichannel:

  1. 請確定 SMB 多重通道會在多個網路介面卡設定中運作。Make sure SMB Multichannel operates in a multiple network adapter configuration.

  2. 執行長時間執行的檔案複製作業。Perform a long-running file copy operation.

  3. 當檔案複製作業正在執行時,請將其中一個纜線中斷連線,或停用其中一個網路介面卡,以模擬其中一個網路路徑的故障。While the file copy operation is running, simulate a failure of one of the network paths by disconnecting one of the cables or by disabling one of the network adapters.

  4. 確認檔案複製繼續使用剩餘的網路介面卡,並在沒有任何檔案複製錯誤的情況下運作。Confirm that the file copy continues to use the remaining network adapter and operates without any file copy errors.

請確定沒有其他工作負載使用已中斷連線的網路連接路徑。Make sure there are no other workloads that use the disconnected network connection path. 這項預防措施可避免工作負載中沒有利用 SMB 多重通道的可能失敗。This precaution avoids a possible failure in workloads that do not leverage SMB Multichannel.

確認 SMB 多重通道可正常運作Verify that SMB Multichannel works

您可以使用下列程式來確認 SMB 多重通道是否正常運作。Use the following procedure to verify that SMB Multichannel works.

  1. 若要確認網路介面卡設定是否正確,請在 SMB 伺服器和 SMB 用戶端的 Windows PowerShell 中輸入下列資訊。To verify network adapter configuration is correct, type the following in Windows PowerShell on both the SMB server and the SMB client.

    Get-NetAdapter
    Get-NetAdapterRSS
    Get-NetAdapterRDMA
    Get-NetAdapterHardwareInfo
    
  2. 若要確認是否已啟用 SMB 多重通道,請確認 SMB 正確地識別網路介面卡,且已正確識別網路介面卡的 RSS 和 RDMA 功能,請執行下列動作:To verify that SMB Multichannel is enabled, confirm that SMB correctly identifies the network adapters, and that the network adapter’s RSS and RDMA capabilities are correctly identified, do the following:

    在 SMB 用戶端上,于 Windows PowerShell 中輸入下列內容:On the SMB client, type the following in Windows PowerShell:

    Get-SmbClientConfiguration | Select EnableMultichannel
    Get-SmbClientNetworkInterface
    

    在 SMB 伺服器上,于 Windows PowerShell 中輸入下列內容:On the SMB server, type the following in Windows PowerShell:

    Get-SmbServerConfiguration | Select EnableMultichannel
    Get-SmbServerNetworkInterface
    
  3. 在 SMB 用戶端上,執行長時間執行的檔案複製作業,以建立與 SMB 伺服器進行中的會話。On the SMB client, perform a long-running file copy operation that creates an ongoing session with the SMB server. 當複製作業正在執行時,請在 Windows PowerShell 中輸入下列程式,以確認連接使用正確的 SMB 版本,且 SMB 多重通道可以運作。While the copy operation is running, type the following in Windows PowerShell to verify that the connection uses the right version of SMB and that SMB Multichannel works.

    Get-SmbConnection
    Get-SmbMultichannelConnection
    Get-SmbMultichannelConnection -IncludeNotSelected
    

後續步驟Next steps

如需相關資訊,另請參閱:For related information, see also: