效能調整網路介面卡Performance Tuning Network Adapters

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

您可以使用此主題效能調整網路介面卡正在執行 Windows Server 2016 的電腦已安裝。You can use this topic to performance tune network adapters that are installed in computers that are running Windows Server 2016.

針對下列變數網路介面卡而定,判斷正確的調整設定:Determining the correct tuning settings for your network adapter depend on the following variables:

  • 網路介面卡和其功能The network adapter and its feature set

  • 伺服器所執行的工作負載的類型The type of workload performed by the server

  • 伺服器硬體和軟體資源The server hardware and software resources

  • 效能伺服器的目標Your performance goals for the server

如果您的網路介面卡提供微調選項,您可以將網路達到最佳輸送量根據上述的參數輸送量和資源使用最佳化。If your network adapter provides tuning options, you can optimize network throughput and resource usage to achieve optimum throughput based on the parameters described above.

下列章節描述部分微調選項效能。The following sections describe some of your performance tuning options.

讓承載功能 Enabling Offload Features

將網路介面卡承載功能是通常有幫助。Turning on network adapter offload features is usually beneficial. 有時候,但是網路介面卡足以不處理輸送量高承載功能。Sometimes, however, the network adapter is not powerful enough to handle the offload capabilities with high throughput.

重要

不要使用承載功能IPsec 工作卸載TCP Chimney 卸載Do not use the offload features IPsec Task Offload or TCP Chimney Offload. 這些技術已在 Windows Server 2016 取代,可能會影響伺服器與網路的效能。These technologies are deprecated in Windows Server 2016, and might adversely affect server and networking performance. 此外,這些技術可能不支援 Microsoft 未來。In addition, these technologies might not be supported by Microsoft in the future.

例如,啟用分割承載可以減少某些網路介面卡上的最大持續輸送量因為資源受限的硬體。For example, enabling segmentation offload can reduce the maximum sustainable throughput on some network adapters because of limited hardware resources. 不過,如果減少的輸送量不是一項限制,您應該讓承載功能,即使這種類型的網路介面卡。However, if the reduced throughput is not expected to be a limitation, you should enable offload capabilities, even for this type of network adapter.

注意

某些網路介面卡需要承載功能將獨立支援傳送和接收的路徑。Some network adapters require offload features to be independently enabled for send and receive paths.

就會收到側邊的網頁伺服器縮放比例 (RSS) Enabling Receive Side Scaling (RSS) for Web Servers

RSS 改善 web 延展性和效能時有較少的網路介面卡比邏輯處理器伺服器上。RSS can improve web scalability and performance when there are fewer network adapters than logical processors on the server. 當您所有的網路流量後續 RSS 能力的網路介面卡時,來自不同連接網站要求可以同時處理跨不同的 Cpu。When all the web traffic is going through the RSS-capable network adapters, incoming web requests from different connections can be simultaneously processed across different CPUs.

請務必注意,因為 RSS 和超傳輸中的邏輯載入通訊協定 (HTTP)、效能可能降低嚴重如果 RSS 功能的網路介面卡接受網路流量有一或多個 RSS 能力的網路介面卡的伺服器上。It is important to note that due to the logic in RSS and Hypertext Transfer Protocol (HTTP) for load distribution, performance might be severely degraded if a non-RSS-capable network adapter accepts web traffic on a server that has one or more RSS-capable network adapters. 這種情況下,您應該使用 RSS 能力網路介面卡或停用的網路介面卡屬性 RSS進階屬性索引標籤。若要判斷是否為 RSS 能力的網路介面卡,您可以檢視 RSS 資訊的網路介面卡屬性進階屬性索引標籤。In this circumstance, you should use RSS-capable network adapters or disable RSS on the network adapter properties Advanced Properties tab. To determine whether a network adapter is RSS-capable, you can view the RSS information on the network adapter properties Advanced Properties tab.

RSS 設定檔和 RSS 佇列RSS Profiles and RSS Queues

預設 RSS 預先定義的個人檔案是作業系統的努馬靜態,可從先前版本變更預設的行為。The default RSS predefined profile is NUMA Static, which changes the default behavior from previous versions of the operating system. 若要開始使用 RSS 設定檔,您可以檢視可用的設定檔,以了解時有幫助,以及他們如何套用到您的網路環境和硬體。To get started with RSS Profiles, you can review the available profiles to understand when they are beneficial and how they apply to your network environment and hardware.

例如,如果您開放工作管理員],並檢視您的伺服器上的邏輯處理器,它們會接收流量充分看起來您可以嘗試增加 RSS 佇列預設為 2 到您的網路介面卡所支援的最大的數目。For example, if you open Task Manager and review the logical processors on your server, and they seem to be underutilized for receive traffic, 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 might have options to change the number of RSS queues as part of the driver.

增加網路介面卡的資源 Increasing Network Adapter Resources

允許的資源手動設定,例如接收和傳送緩衝區的網路介面卡,您應該會增加配置的資源。For network adapters that allow manual configuration of resources, such as receive and send buffers, you should increase the allocated resources.

某些網路介面卡為他們接收緩衝區低配置節省記憶體的主機。Some network adapters set their receive buffers low to conserve allocated memory from the host. 捨棄的封包和降低的效能會導致低值。The low value results in dropped packets and decreased performance. 因此,針對接收大量案例中,我們建議您提高接收緩衝到最大值。Therefore, for receive-intensive scenarios, we recommend that you increase the receive buffer value to the maximum.

注意

如果網路介面卡未公開手動資源設定,它可能動態設定資源,或資源設定無法變更為修正值。If a network adapter does not expose manual resource configuration, it either dynamically configures the resources, or the resources are set to a fixed value that cannot be changed.

讓中斷仲裁Enabling Interrupt Moderation

若要控制中斷仲裁,某些網路介面卡公開不同中斷仲裁層級,緩衝聯合參數 (有時候分開的傳送和接收緩衝),或兩者。To control interrupt moderation, some network adapters expose different interrupt moderation levels, buffer coalescing parameters (sometimes separately for send and receive buffers), or both.

您應該會中斷仲裁 cpu 的工作負載,請考慮將和較延遲和更多中斷因為,請考慮增加主機 CPU 節省之間與增加主機 CPU 節省延遲。You should consider interrupt moderation for CPU-bound workloads, and consider the trade-off between the host CPU savings and latency versus the increased host CPU savings because of more interrupts and less latency. 如果網路介面卡不會執行中斷仲裁,但它將會公開緩衝聯合、增加聯合緩衝區數目允許更多緩衝區每次傳送或接收,這可以改善效能。If the network adapter does not perform interrupt moderation, but it does expose buffer coalescing, increasing the number of coalesced buffers allows more buffers per send or receive, which improves performance.

調整低延遲封包處理效能 Performance Tuning for Low Latency Packet Processing

許多網路介面卡提供選項來最佳化作業系統導致延遲。Many network adapters provide options to optimize operating system-induced latency. 延遲是經過時間處理連入封包網路驅動程式和網路驅動程式,傳送回封包。Latency is the elapsed time between the network driver processing an incoming packet and the network driver sending the packet back. 這次通常被以毫秒。This time is usually measured in microseconds. 相較之下,封包傳輸到長距離的傳輸時間器通常測量(毫秒)\ (重要性順序 larger)。For comparison, the transmission time for packet transmissions over long distances is usually measured in milliseconds (an order of magnitude larger). 這項調整將會減少封包傳輸中所花費的時間。This tuning will not reduce the time a packet spends in transit.

以下是一些調整建議微秒敏感網路的效能。Following are some performance tuning suggestions for microsecond-sensitive networks.

  • 將電腦的 BIOS 設定為高效能,停用 C 狀態。Set the computer BIOS to High Performance, with C-states disabled. 不過,請注意,此系統和 BIOS 相關,某些系統將提供較高的效能,是否作業系統控制項電源管理。However, note that this is system and BIOS dependent, and some systems will provide higher performance if the operating system controls power management. 您可以檢查和調整您的電源管理設定從設定powercfg命令。You can check and adjust your power management settings from Settings or by using the powercfg command. 如需詳細資訊,請查看Powercfg 命令列選項For more information, see Powercfg Command-Line Options

  • 作業系統的電源管理設定檔為高效能系統Set the operating system power management profile to High Performance System. 請注意,此將無法正常運作是否已停用作業系統控制項的電源管理設定系統 BIOS。Note that this will not work properly if the system BIOS has been set to disable operating system control of power management.

  • 範例、UDP 總和檢查、TCP 總和檢查,以及傳送大型卸載 (LSO) 可讓靜態卸載。Enable Static Offloads, for example, UDP Checksums, TCP Checksums, and Send Large Offload (LSO).

  • 如果資料傳輸串流使用多監視器,例如大量多點傳送收到可讓 RSS。Enable RSS if the traffic is multi-streamed, such as high-volume multicast receive.

  • 停用中斷仲裁設定為網路介面卡驅動程式需要的最低可能延遲。Disable the Interrupt Moderation setting for network card drivers that require the lowest possible latency. 請記住,這可以使用更多的 CPU 時間,以及它所代表折衷。Remember, this can use more CPU time and it represents a tradeoff.

  • 核心是所使用的處理一封包程式(使用者執行緒)與共用 CPU 快取核心處理器處理網路介面卡中斷與 Dpc。Handle network adapter interrupts and DPCs on a core processor that shares CPU cache with the core that is being used by the program (user thread) that is handling the packet. CPU 相關性調整可用於處理程序特定邏輯處理器直接搭配 RSS 設定完成這項工作。CPU affinity tuning can be used to direct a process to certain logical processors in conjunction with RSS configuration to accomplish this. 因為 ISR、DPC 及執行緒爭奪核心使用使用相同的核心中斷、DPC,以及使用者模式執行緒表現載入增加更糟效能。Using the same core for the interrupt, DPC, and user mode thread exhibits worse performance as load increases because the ISR, DPC, and thread contend for the use of the core.

系統管理中斷 System Management Interrupts

許多硬體系統使用系統管理中斷 (SMI) 各種不同的維護功能,包括的錯誤修正的程式碼 (ECC) 記憶體錯誤報告、舊版 USB 相容性、粉絲控制和 BIOS 控制電源管理。Many hardware systems use System Management Interrupts (SMI) for a variety of maintenance functions, including reporting of error correction code (ECC) memory errors, legacy USB compatibility, fan control, and BIOS controlled power management.

SMI 是最高優先順序中斷系統上的,並將 CPU 放在了優先執行所有其他活動中斷服務程序,通常會包含在 BIOS 執行時的管理模式。The SMI is the highest priority interrupt on the system and places the CPU in a management mode, which preempts all other activity while it runs an interrupt service routine, typically contained in BIOS.

很抱歉,這可能會導致延遲突然的 100 毫秒或更多。Unfortunately, this can result in latency spikes of 100 microseconds or more.

如果您需要達到最低延遲,您應該硬體提供者所提供的最低盡降低 SMIs 要求 BIOS 版本。If you need to achieve the lowest latency, you should request a BIOS version from your hardware provider that reduces SMIs to the lowest degree possible. 這些是通常稱為「低延遲 BIOS」或「SMI 免費 BIOS」。These are frequently referred to as “low latency BIOS” or “SMI free BIOS.” 有時候,不可能的硬體的平台完全排除 SMI 活動因為它用來控制基本功能(例如,冷卻愛好者)。In some cases, it is not possible for a hardware platform to eliminate SMI activity altogether because it is used to control essential functions (for example, cooling fans).

注意

作業系統可以控制不 SMIs 因為邏輯處理器執行特殊維護模式,可避免作業系統操作。The operating system can exert no control over SMIs because the logical processor is running in a special maintenance mode, which prevents operating system intervention.

調整 TCP 效能 Performance Tuning TCP

您可以效能調整 TCP 使用下列項目。You can performance tune TCP using the following items.

視窗自動調整 TCP 接收 TCP Receive Window Auto-Tuning

Windows Server 2008、之前網路堆疊會使用有限連接的整體潛在輸送量修正大小接收端視窗(65535 位元組)。Prior to Windows Server 2008, the network stack used a fixed-size receive-side window (65,535 bytes) that limited the overall potential throughput for connections. 其中一個最重要的 TCP 堆疊變更為 TCP 收到視窗自動調整。One of the most significant changes to the TCP stack is TCP receive window auto-tuning.

當您使用固定的 TCP 收到視窗的大小,您可以計算單一連接的輸送量總計:You can calculate the total throughput of a single connection when you use a fixed size TCP receive window as:

在位元組總達到輸送量 = TCP 收到視窗大小中位元組 \ * (1 月連接秒的延遲)Total achievable throughput in bytes = TCP receive window size in bytes * (1 / connection latency in seconds)

例如,達到輸送量總計只有在連接的 10 ms 延遲 51 Mbps \(大型公司網路 infrastructure\ 合理值)。For example, the total achievable throughput is only 51 Mbps on a connection with 10 ms latency (a reasonable value for a large corporate network infrastructure).

自動調整不過,接收端視窗是可調整,與是可以增加符合寄件者的需求。With auto-tuning, however, the receive-side window is adjustable, and it can grow to meet the demands of the sender. 也可連接至 1 Gbps 連接的完整列率。It is possible for a connection to achieve a full line rate of a 1 Gbps connection. 網路使用案例,可能會有已受到過去達到輸送量總計的 TCP 連接現在可以完全使用網路。Network usage scenarios that might have been limited in the past by the total achievable throughput of TCP connections can now fully use the network.

過時的 TCP 參數Deprecated TCP parameters

Windows Server 2003 下列登錄設定不再支援,且會忽略在較新版本。The following registry settings from Windows Server 2003 are no longer supported, and are ignored in later versions.

這些設定都有登錄下列位置:All of these settings had the following registry location:

```  
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Tcpip\Parameters  
```  
  • TcpWindowSizeTcpWindowSize

  • NumTcbTablePartitionsNumTcbTablePartitions

  • MaxHashTableSizeMaxHashTableSize

Windows 篩選平台 Windows Filtering Platform

Windows 篩選平台 (WFP),在 Windows Vista 和 Windows Server 2008 非 Microsoft 獨立軟體廠商 (Isv) 來建立封包處理篩選來提供 Api。The Windows Filtering Platform (WFP) that was introduced in Windows Vista and Windows Server 2008 provides APIs to non-Microsoft independent software vendors (ISVs) to create packet processing filters. 範例包含防火牆軟體和防毒軟體。Examples include firewall and antivirus software.

注意

不良的 WFP 篩選會大幅降低伺服器的網路效能。A poorly written WFP filter can significantly decrease a server’s networking performance. 如需詳細資訊,請查看移植封包處理驅動程式和 App WFP在 Windows 開發人員中心。For more information, see Porting Packet-Processing Drivers and Apps to WFP in the Windows Dev Center.

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