選擇 [網路介面卡Choosing a Network Adapter

適用於:Windows Server(以每年次管道)、Windows Server 2016Applies To: Windows Server (Semi-Annual Channel), Windows Server 2016

您可以使用本主題以了解部分的網路介面卡可能會影響您的購買選擇的功能。You can use this topic to learn some of the features of network adapters that might affect your purchasing choices.

網路大量的應用程式需要高效能網路介面卡。Network-intensive applications require high-performance network adapters. 本章節瀏覽來選擇網路介面卡,以及如何設定不同的網路介面卡設定,以獲得最佳的網路效能的事項。This section explores some considerations for choosing network adapters, as well as how to configure different network adapter settings to achieve the best network performance.

提示

您可以使用 Windows PowerShell 來設定網路介面卡設定。You can configure network adapter settings by using Windows PowerShell. 如需詳細資訊,請查看[Windows PowerShell 中的 網路介面卡 CmdletFor more information, see Network Adapter Cmdlets in Windows PowerShell.

卸載功能 Offload Capabilities

將卸載中央處理中的工作 (CPU) 到網路介面卡可以減少 CPU 使用率在伺服器上,這可以改善整體的系統效能。Offloading tasks from the central processing unit (CPU) to the network adapter can reduce CPU usage on the server, which improves the overall system performance.

網路中的堆疊 Microsoft 你可以卸一或多個任務的網路介面卡,如果您選取適當的網路介面卡卸載功能。The network stack in Microsoft products can offload one or more tasks to a network adapter if you select a network adapter that has the appropriate offload capabilities. 下表提供可在 Windows Server 2016 的不同承載功能的簡短的概觀。The following table provides a brief overview of different offload capabilities that are available in Windows Server 2016.

卸載類型Offload type 描述Description
檢查值計算 tcpChecksum calculation for TCP 網路堆疊可以卸計算與驗證的傳輸控制項通訊協定 (TCP) 總和檢查上傳送和接收驗證碼的路徑。The network stack can offload the calculation and validation of Transmission Control Protocol (TCP) checksums on send and receive code paths. 也可以卸計算和驗證的 [IPv4,並在 [IPv6 總和檢查傳送和接收驗證碼的路徑。It can also offload the calculation and validation of IPv4 and IPv6 checksums on send and receive code paths.
檢查值計算 UDPChecksum calculation for UDP 網路堆疊可以卸計算及使用者資料流通訊協定 (UDP) 總和檢查上的驗證傳送和接收驗證碼的路徑。The network stack can offload the calculation and validation of User Datagram Protocol (UDP) checksums on send and receive code paths.
檢查值計算 IPv4Checksum calculation for IPv4 網路堆疊可以下載計算和驗證的 IPv4 總和檢查上的傳送和接收驗證碼的路徑。The network stack can offload the calculation and validation of IPv4 checksums on send and receive code paths.
檢查值計算 ipv6Checksum calculation for IPv6 網路堆疊可以下載計算和驗證的 IPv6 總和檢查上的傳送和接收驗證碼的路徑。The network stack can offload the calculation and validation of IPv6 checksums on send and receive code paths.
大 TCP 封包分割可Segmentation of large TCP packets TCP/IP 傳輸層支援大型傳送卸載 v2 (LSOv2)。The TCP/IP transport layer supports Large Send Offload v2 (LSOv2). 使用 LSOv2,TCP/IP 傳輸層可以下載分割的網路介面卡大型 TCP 封包。With LSOv2, the TCP/IP transport layer can offload the segmentation of large TCP packets to the network adapter.
接收縮放比例 (RSS) 側邊Receive Side Scaling (RSS) RSS 是讓有效率通訊網路的網路驅動程式技術跨多個 Cpu 處理收到多處理器系統中。RSS is a network driver technology that enables the efficient distribution of network receive processing across multiple CPUs in multiprocessor systems. 稍後本主題會提供更多詳細資訊的 RSS。More detail about RSS is provided later in this topic.
接收聯合 (RSC) 區段Receive Segment Coalescing (RSC) RSC 是在一起,以減少處理標頭群組封包的功能需要執行主機。RSC is the ability to group packets together to minimize the header processing that is necessary for the host to perform. 最多 64 KB 收到裝載的可以聯合成單一的處理大封包。A maximum of 64 KB of received payload can be coalesced into a single larger packet for processing. 稍後本主題會提供 RSC 有關更多詳細資料。More detail about RSC is provided later in this topic.

接收側邊縮放比例 Receive Side Scaling

Windows Server 2016、Windows Server 2012、Windows Server 2012 R2、Windows Server 2008 R2 和 Windows Server 2008 支援收到側邊縮放比例 (RSS)。Windows Server 2016, Windows Server 2012, Windows Server 2012 R2, Windows Server 2008 R2, and Windows Server 2008 support Receive Side Scaling (RSS).

會以多個邏輯處理器共用硬體資源設定部分伺服器 \(例如所在 core),這會被視為同時多執行緒 (SMT) 對等。Some servers are configured with multiple logical processors that share hardware resources (such as a physical core) and which are treated as Simultaneous Multi-Threading (SMT) peers. Intel 超執行緒技術為範例。Intel Hyper-Threading Technology is an example. RSS 指示核心每一個最多邏輯處理器網路處理。RSS directs network processing to up to one logical processor per core. 例如,含 Hyper-v 的 Intel 執行緒、4 核心和 8 邏輯處理器的伺服器上, RSS 使用超過 4 邏輯處理器網路處理。For example, on a server with Intel Hyper-Threading, 4 cores, and 8 logical processors, RSS uses no more than 4 logical processors for network processing.

RSS 分散邏輯處理器之間連入網路 I/O 封包,以便在相同的邏輯處理器,可保留訂購處理屬於相同的 TCP 連接封包。RSS distributes incoming network I/O packets among logical processors so that packets which belong to the same TCP connection are processed on the same logical processor, which preserves ordering.

RSS 也會載入餘額 UDP 單和多點的流量,以及路由相關的流量 \(這由 hashing 來源和目的地 addresses\)以相同的邏輯處理器保留相關 app 的順序。RSS also load balances UDP unicast and multicast traffic, and it routes related flows (which are determined by hashing the source and destination addresses) to the same logical processor, preserving the order of related arrivals. 這可協助改善延展性和效能會收到案例中有超過一般符合資格的邏輯處理器較少的網路介面卡的伺服器。This helps improve scalability and performance for receive-intensive scenarios for servers that have fewer network adapters than they do eligible logical processors.

設定 RSSConfiguring RSS

在 Windows Server 2016 中,您可以設定 RSS 使用 Windows PowerShell cmdlet 和 RSS 設定檔。In Windows Server 2016, you can configure RSS by using Windows PowerShell cmdlets and RSS profiles.

您可以定義 RSS 設定檔,使用– 設定檔的參數設定為 NetAdapterRss Windows PowerShell cmdlet。You can define RSS profiles by using the –Profile parameter of the Set-NetAdapterRss Windows PowerShell cmdlet.

Windows PowerShell 命令 RSS 設定Windows PowerShell commands for RSS configuration

下列 cmdlet 可讓您查看與修改 RSS 參數每網路介面卡。The following cmdlets allow you to see and modify RSS parameters per network adapter.

注意

命令的詳細參考的每個 cmdlet,包括語法與參數,您可以按一下下列連結。For a detailed command reference for each cmdlet, including syntax and parameters, you can click the following links. 此外,您可以將傳遞 cmdlet 名稱以取得-協助在每一個命令的詳細資訊的 Windows PowerShell 命令提示字元。In addition, you can pass the cmdlet name to Get-Help at the Windows PowerShell prompt for details on each command.

RSS 設定檔RSS profiles

您可以使用– 設定檔cmdlet Set-NetAdapterRss 指定的邏輯處理器已指派給的網路介面卡的參數。You can use the –Profile parameter of the Set-NetAdapterRss cmdlet to specify which logical processors are assigned to which network adapter. 使用此參數值︰Available values for this parameter are:

  • 接近Closest. 網路介面卡的基底 RSS 處理器附近的邏輯處理器數字的慣用。Logical processor numbers that are near the network adapter’s base RSS processor are preferred. 使用此設定擋,可能會重新邏輯處理器動態根據負載平衡作業系統。With this profile, the operating system might rebalance logical processors dynamically based on load.

  • ClosestStaticClosestStatic. 較靠近網路介面卡的基底 RSS 處理器邏輯處理器數字。Logical processor numbers near the network adapter’s base RSS processor are preferred. 使用此設定擋,作業系統會不重新平衡邏輯動態根據載入的處理器。With this profile, the operating system does not rebalance logical processors dynamically based on load.

  • 努馬NUMA. 在不同努馬節點散發載入通常選取邏輯處理器編號。Logical processor numbers are generally selected on different NUMA nodes to distribute the load. 使用此設定擋,可能會重新邏輯處理器動態根據負載平衡作業系統。With this profile, the operating system might rebalance logical processors dynamically based on load.

  • NUMAStaticNUMAStatic. 這是預設設定檔This is the default profile. 在不同努馬節點散發載入通常選取邏輯處理器編號。Logical processor numbers are generally selected on different NUMA nodes to distribute the load. 使用此設定擋,作業系統會不會重新平衡根據載入動態邏輯處理器。With this profile, the operating system will not rebalance logical processors dynamically based on load.

  • 保守Conservative. RSS 使用維持載入盡可能較少的處理器。RSS uses as few processors as possible to sustain the load. 這個選項可協助您減少中斷。This option helps reduce the number of interrupts.

根據您案例和工作負載特性,您也可以使用其他的參數設定為 NetAdapterRss Windows PowerShell cmdlet 指定下列:Depending on the scenario and the workload characteristics, you can also use other parameters of the Set-NetAdapterRss Windows PowerShell cmdlet to specify the following:

  • 在每次網路介面卡,多少邏輯處理器可用於 RSS。On a per-network adapter basis, how many logical processors can be used for RSS.
  • 從時差各種不同的邏輯處理器。The starting offset for the range of logical processors.
  • [網路介面卡將會從的配置記憶體] 節點。The node from which the network adapter allocates memory.

以下是詳細設定為 NetAdapterRss參數,可供您設定 RSS:Following are the additional Set-NetAdapterRss parameters that you can use to configure RSS:

注意

在每個參數網路介面卡的名稱下方的範例語法乙太網路使用做為範例值– 名稱的參數設定-NetAdapterRss命令。In the example syntax for each parameter below, the network adapter name Ethernet is used as an example value for the –Name parameter of the Set-NetAdapterRss command. 當您執行 cmdlet 時,請確定您使用的網路介面卡名稱會根據您的環境。When you run the cmdlet, ensure that the network adapter name that you use is appropriate for your environment.

  • \ * MaxProcessors:設定 RSS 處理器来使用的最大。* MaxProcessors: Sets the maximum number of RSS processors to be used. 這樣可確保的應用程式流量繫結至上限處理器指定介面。This ensures that application traffic is bound to a maximum number of processors on a given interface. 範例語法:Example syntax:

    Set-NetAdapterRss –Name “Ethernet” –MaxProcessors <value>

  • \ * BaseProcessorGroup:設定努馬節點的基底處理器群組。* BaseProcessorGroup: Sets the base processor group of a NUMA node. 這會影響 RSS 使用處理器陣列。This impacts the processor array that is used by RSS. 範例語法:Example syntax:

    Set-NetAdapterRss –Name “Ethernet” –BaseProcessorGroup <value>

  • \ * MaxProcessorGroup:設定努馬節點的最大值處理器群組。* MaxProcessorGroup: Sets the Max processor group of a NUMA node. 這會影響 RSS 使用處理器陣列。This impacts the processor array that is used by RSS. 此設定會限制最大的處理器群組,因此負載平衡對齊 k 群組中。Setting this would restrict a maximum processor group so that load balancing is aligned within a k-group. 範例語法:Example syntax:

    Set-NetAdapterRss –Name “Ethernet” –MaxProcessorGroup <value>

  • \ * BaseProcessorNumber:設定努馬節點的基底的處理器。* BaseProcessorNumber: Sets the base processor number of a NUMA node. 這會影響 RSS 使用處理器陣列。This impacts the processor array that is used by RSS. 這可讓所有網路介面卡分割處理器。This allows partitioning processors across network adapters. 這是第一個邏輯處理器在各種不同的 RSS 處理器指派給每個顯示卡。This is the first logical processor in the range of RSS processors that is assigned to each adapter. 範例語法:Example syntax:

    Set-NetAdapterRss –Name “Ethernet” –BaseProcessorNumber <Byte Value>

  • \ * NumaNode:的每個網路介面卡可以配置從記憶體努馬節點。* NumaNode: The NUMA node that each network adapter can allocate memory from. 這可以是 k 群組中,或從不同的 k 群組。This can be within a k-group or from different k-groups. 範例語法:Example syntax:

    Set-NetAdapterRss –Name “Ethernet” –NumaNodeID <value>

  • \ * NumberofReceiveQueues:您邏輯處理器似乎充分接收流量 \(例如,在檢視中工作 Manager\),您可以嘗試增加 RSS 佇列預設為 2 到您的網路介面卡所支援的最大的數目。* NumberofReceiveQueues: If your logical processors seem to be underutilized for receive traffic (for example, as viewed in Task Manager), you can try increasing the number of RSS queues from the default of 2 to the maximum that is supported by your network adapter. 您的網路介面卡可能會有選項] 來變更的數目 RSS 佇列驅動程式的一部分。Your network adapter may have options to change the number of RSS queues as part of the driver. 範例語法:Example syntax:

    Set-NetAdapterRss –Name “Ethernet” –NumberOfReceiveQueues <value>

如需詳細資訊,請按一下下列連結來下載延展性網路:排除收到處理瓶頸 — 簡介 RSS文字的格式。For more information, click the following link to download Scalable Networking: Eliminating the Receive Processing Bottleneck—Introducing RSS in Word format.

了解 RSS 效能Understanding RSS Performance

調整 RSS 需要了解設定和負載平衡邏輯。Tuning RSS requires understanding the configuration and the load-balancing logic. 確認已生效 RSS 設定,您在執行時,您可以檢視輸出到取得-NetAdapterRss Windows PowerShell cmdlet。To verify that the RSS settings have taken effect, you can review the output when you run the Get-NetAdapterRss Windows PowerShell cmdlet. 以下是此 cmdlet 的範例輸出。Following is example output of this cmdlet.


PS C:\Users\Administrator> get-netadapterrss  
Name                           : testnic 2  
InterfaceDescription           : Broadcom BCM5708C NetXtreme II GigE (NDIS VBD Client) #66
Enabled                        : True
NumberOfReceiveQueues          : 2
Profile                        : NUMAStatic
BaseProcessor: [Group:Number]  : 0:0
MaxProcessor: [Group:Number]   : 0:15
MaxProcessors                  : 8

IndirectionTable: [Group:Number]:
     0:0    0:4    0:0    0:4    0:0    0:4    0:0    0:4  
…   
(# indirection table entries are a power of 2 and based on # of processors)  
…   
                          0:0    0:4    0:0    0:4    0:0    0:4    0:0    0:4  

除了回應所設定的參數,輸出主要層面是間接表格輸出。In addition to echoing parameters that were set, the key aspect of the output is the indirection table output. 間接下表顯示 hash 資料表的容量,用來輸入流量。The indirection table displays the hash table buckets that are used to distribute incoming traffic. 在此範例中,表示法 n:c 指定努馬 K-用來引導輸入流量的群組:CPU 索引配對。In this example, the n:c notation designates the Numa K-Group:CPU index pair that is used to direct incoming traffic. 我們會看到完全 2 獨特的項目 (0:0,0:4),這代表 k 群組 0 日 cpu0 和 k 群組 0 日 cpu 4 分別。We see exactly 2 unique entries (0:0 and 0:4), which represent k-group 0/cpu0 and k-group 0/cpu 4, respectively.

只有一個 k-群組此系統(k 群組 0)和 n (其中 n < = 128) 間接表項目。There is only one k-group for this system (k-group 0) and a n (where n <= 128) indirection table entry. 因為佇列接收的數字為 2,2 處理器 (0:0,0:4) 選擇-即使是最大的處理器為 8。Because the number of receive queues is set to 2, only 2 processors (0:0, 0:4) are chosen - even though maximum processors is set to 8. 事實上,間接表格 hashing 傳入僅使用 2 Cpu 退出 8 可用的資料傳輸。In effect, the indirection table is hashing incoming traffic to only use 2 CPUs out of the 8 that are available.

若要充分運用 Cpu,等於或大於最大的處理器必須是 RSS 收到佇列數目。To fully utilize the CPUs, the number of RSS Receive Queues must be equal to or greater than Max Processors. 在前一個範例中,會收到佇列應會設定為 8 或更高。In the previous example, the Receive Queue should be set to 8 or greater.

NIC 小組與 RSSNIC Teaming and RSS

在 [網路介面卡的就使用其他網路介面卡使用 NIC 團隊合作,以用 RSS。RSS can be enabled on a network adapter that is teamed with another network interface card using NIC Teaming. 在本案例中,只有基礎實體網路介面卡可以使用 RSS 設定。In this scenario, only the underlying physical network adapter can be configured to use RSS. 使用者無法設定 RSS cmdlet 小組的網路介面卡上。A user cannot set RSS cmdlets on the teamed network adapter.

接收區段聯合 (RSC) Receive Segment Coalescing (RSC)

減少的 IP 標頭一段指定收到的資料的處理來接收區段聯合 (RSC) 協助效能。Receive Segment Coalescing (RSC) helps performance by reducing the number of IP headers that are processed for a given amount of received data. 它應該會用來協助縮放收到的資料的效能的群組 (or coalescing) 較小的封包到較大的單位。It should be used to help scale the performance of received data by grouping (or coalescing) the smaller packets into larger units.

這種方式可以影響延遲的優點大部分輸送量所示。This approach can affect latency with benefits mostly seen in throughput gains. RSC 增加輸送量收到重裝工作負載的建議。RSC is recommended to increase throughput for received heavy workloads. 請考慮部署支援 RSC 網路介面卡。Consider deploying network adapters that support RSC.

這些網路介面卡,請確定 RSC 位於 \(這是預設 setting\),除非您有特定的工作負載 \(例如,低延遲、低輸送量 networking\)RSC 被關閉該顯示的收穫。On these network adapters, ensure that RSC is on (this is the default setting), unless you have specific workloads (for example, low latency, low throughput networking) that show benefit from RSC being off.

了解 RSC 診斷Understanding RSC Diagnostics

您可以使用 Windows PowerShell cmdlet 診斷 RSC取得-NetAdapterRsc取得-NetAdapterStatisticsYou can diagnose RSC by using the Windows PowerShell cmdlets Get-NetAdapterRsc and Get-NetAdapterStatistics.

當您執行 Get-NetAdapterRsc cmdlet 時,以下是範例輸出。Following is example output when you run the Get-NetAdapterRsc cmdlet.


PS C:\Users\Administrator> Get-NetAdapterRsc  

Name                       IPv4Enabled  IPv6Enabled  IPv4Operational IPv6Operational               IPv4FailureReason              IPv6Failure  
                                            Reason  
----                           -----------  -----------  --------------- --------------- ----------------- ------------  
Ethernet                       True         False        True            False                  NoFailure       NicProperties  

取得cmdlet 會顯示在介面 RSC 功能的是否和 TCP 是否讓 RSC 操作狀態。The Get cmdlet shows whether RSC is enabled in the interface and whether TCP enables RSC to be in an operational state. 失敗的原因提供詳細資訊,可讓介面 RSC 失敗。The failure reason provides details about the failure to enable RSC on that interface.

在前一個案例中,IPv4 RSC 處於支援及操作介面。In the previous scenario, IPv4 RSC is supported and operational in the interface. 若要了解診斷失敗,其中一個可以看到聯合的位元組或例外造成。To understand diagnostic failures, one can see the coalesced bytes or exceptions caused. 這會提供聯合問題的指示。This provides an indication of the coalescing issues.

當您執行 Get-NetAdapterStatistics cmdlet 時,以下是範例輸出。Following is example output when you run the Get-NetAdapterStatistics cmdlet.

PS C:\Users\Administrator> $x = Get-NetAdapterStatistics “myAdapter”   
PS C:\Users\Administrator> $x.rscstatistics  

CoalescedBytes       : 0  
CoalescedPackets     : 0  
CoalescingEvents     : 0  
CoalescingExceptions : 0  

RSC 和模擬RSC and Virtualization

RSC 僅支援實體主機主機網路介面卡未繫結至 HYPER-V Virtual 開關切換至時。RSC is only supported in the physical host when the host network adapter is not bound to the Hyper-V Virtual Switch. 當您的主機繫結至 HYPER-V Virtual 開關切換至作業系統已停用 RSC。RSC is disabled by the operating system when the host is bound to the Hyper-V Virtual Switch. 此外,虛擬電腦不會取得 RSC 的優點,RSC 不支援 virtual 網路介面卡因為。In addition, virtual machines do not get the benefit of RSC because virtual network adapters do not support RSC.

RSC 時支援單一根輸入/輸出模擬 (SR-IOV) 是可以進行一樣。RSC can be enabled for a virtual machine when Single Root Input/Output Virtualization (SR-IOV) is enabled. 若是如此,virtual 功能支援 RSC 功能。因此,虛擬電腦也會收到 RSC 的好處。In this case, virtual functions support RSC capability; hence, virtual machines also receive the benefit of RSC.

網路介面卡的資源 Network Adapter Resources

幾個網路介面卡正在管理他們的資源達到最佳效能。A few network adapters actively manage their resources to achieve optimum performance. 幾個網路介面卡,可讓您手動設定使用的資源進階網路索引標籤的 [顯示卡。Several network adapters allow you to manually configure resources by using the Advanced Networking tab for the adapter. 這類介面卡,您可以設定的參數,包括緩衝區接收的數字的數字的值,並傳送緩衝區。For such adapters, you can set the values of a number of parameters, including the number of receive buffers and send buffers.

使用下列的 Windows PowerShell cmdlet 已簡化設定網路介面卡的資源。Configuring network adapter resources is simplified by the use of the following Windows PowerShell cmdlets.

如需詳細資訊,請查看[Windows PowerShell 中的 網路介面卡 CmdletFor more information, see Network Adapter Cmdlets in Windows PowerShell.

本指南所有主題的連結,會看到的網路效能子系統調整For links to all topics in this guide, see Network Subsystem Performance Tuning.