性能优化网络适配器Performance Tuning Network Adapters

适用于:Windows Server 2019、Windows Server 2016、Windows Server(半年频道)Applies to: Windows Server 2019, Windows Server 2016, Windows Server (Semi-Annual Channel)

使用本主题中的信息来优化运行 Windows Server 2016 及更高版本的计算机的性能网络适配器。Use the information in this topic to tune the performance network adapters for computers that are running Windows Server 2016 and later versions. 如果网络适配器提供了优化选项,则可以使用这些选项优化网络吞吐量和资源使用情况。If your network adapters provide tuning options, you can use these options to optimize network throughput and resource usage.

网络适配器的正确调整设置取决于以下变量:The correct tuning settings for your network adapters depend on the following variables:

  • 网络适配器及其功能集The network adapter and its feature set
  • 服务器执行的工作负荷类型The type of workload that the server performs
  • 服务器硬件和软件资源The server hardware and software resources
  • 服务器的性能目标Your performance goals for the server

以下各部分介绍了某些性能优化选项。The following sections describe some of your performance tuning options.

启用卸载功能Enabling offload features

启用网络适配器卸载功能通常会带来好处。Turning on network adapter offload features is usually beneficial. 但是,网络适配器可能不够强大,无法处理高吞吐量的卸载功能。However, the network adapter might not be powerful enough to handle the offload capabilities with high throughput.

重要

不要使用卸载功能IPsec 任务卸载TCP 烟囱卸载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, consider a network adapter that has limited hardware resources. 在这种情况下,启用分段卸载功能可能会降低适配器的最大可持续吞吐量。In that case, enabling segmentation offload features might reduce the maximum sustainable throughput of the adapter. 但是,如果可接受降低的吞吐量,则应该继续启用分段卸载功能。However, if the reduced throughput is acceptable, you should go ahead an enable the segmentation offload features.

备注

某些网络适配器要求独立于发送和接收路径启用卸载功能。Some network adapters require you to enable offload features independently for the send and receive paths.

为 web 服务器启用接收方缩放 (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. 当所有 web 流量都通过支持 RSS 的网络适配器时,服务器可以跨不同的 Cpu 同时处理来自不同连接的传入 web 请求。When all the web traffic is going through the RSS-capable network adapters, the server can process incoming web requests from different connections simultaneously across different CPUs.

重要

避免在同一服务器上同时使用非 RSS 网络适配器和支持 RSS 的网络适配器。Avoid using both non-RSS network adapters and RSS-capable network adapters on the same server. 由于 RSS 和超文本传输协议中的负载分配逻辑 (HTTP) ,如果不支持 RSS 的网络适配器接受具有一个或多个支持 RSS 的网络适配器的服务器上的 web 流量,则性能可能会受到严重降级。Because of the load distribution logic in RSS and Hypertext Transfer Protocol (HTTP), 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。In this circumstance, you should use RSS-capable network adapters or disable RSS on the network adapter properties Advanced Properties tab.

若要确定网络适配器是否支持 RSS,你可以在网络适配器属性“高级属性”**** 选项卡上查看 RSS 信息。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 预定义配置文件为NUMAStatic,不同于以前版本的 Windows 使用的默认配置文件。The default RSS predefined profile is NUMAStatic, which differs from the default that the previous versions of Windows used. 开始使用 RSS 配置文件之前,请查看可用的配置文件,了解它们有哪些好处,以及如何将它们应用于网络环境和硬件。Before you start using RSS profiles, 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 two to the maximum that your network adapter supports. 你的网络适配器可能具有将 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 you to manually configure 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, either it 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, different buffer coalescing parameters (sometimes separately for send and receive buffers), or both.

对于 CPU 绑定的工作负荷,应考虑中断裁决。You should consider interrupt moderation for CPU-bound workloads. 使用中断裁决时,请考虑在主机 CPU 节省和延迟之间进行权衡,同时降低主机 CPU 的节省,因为有更多中断,延迟更少。When using interrupt moderation, 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, you can improve performance by increasing the number of coalesced buffers to allow more buffers per send or receive.

低延迟数据包处理的性能优化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. 为了进行比较,远距离的数据包传输的传输时间通常以毫秒为单位(增大一个数量级)。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 设置为高性能,并禁用 CPU 电源状态。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 设置为禁用电源管理的操作系统控制,则此设置不能正常工作。This setting does not work properly if the system BIOS has been set to disable operating system control of power management.

  • 启用静态卸载。Enable static offloads. 例如,启用 UDP 校验和,TCP 校验和,并 (LSO) 设置中发送大卸载。For example, enable the UDP Checksums, TCP Checksums, and Send Large Offload (LSO) settings.

  • 如果流量经过多流式处理(例如,在接收大容量多播流量时),请启用 RSS。If the traffic is multi-streamed, such as when receiving high-volume multicast traffic, enable RSS.

  • 针对需要可能的最低延迟的网卡驱动程序,禁用中断裁决设置。Disable the Interrupt Moderation setting for network card drivers that require the lowest possible latency. 请记住,此配置可以使用更多的 CPU 时间,它表示一个折衷。Remember, this configuration can use more CPU time and it represents a tradeoff.

  • 在内核处理器上处理网络适配器中断和 DPC,该处理器与处理数据包的程序(用户线程)所用的内核共享 CPU 缓存。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. 将相同的内核用于中断、DPC 和用户模式线程会随着负载的增加而表现出最差的性能,因为 ISR、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-S) 用于各种维护功能,如报告错误更正代码 (ECC) 内存错误、维护旧的 USB 兼容性、控制风扇和管理 BIOS 控制的电源设置。Many hardware systems use System Management Interrupts (SMI) for a variety of maintenance functions, such as reporting error correction code (ECC) memory errors, maintaining legacy USB compatibility, controlling the fan, and managing BIOS-controlled power settings.

SMI 是系统上的最高优先级中断,并将 CPU 置于管理模式下。The SMI is the highest-priority interrupt on the system, and places the CPU in a management mode. 此模式抢先于所有其他活动,而 SMI 运行中断服务例程(通常包含在 BIOS 中)。This mode preempts all other activity while SMI runs an interrupt service routine, typically contained in BIOS.

遗憾的是,这种行为可能导致延迟达100微秒或更长时间。Unfortunately, this behavior can result in latency spikes of 100 microseconds or more.

如果你需要达到最低延迟,应要求你的硬件提供商提供可将 SMI 降低到可能的最低程度的 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 版本经常称为 "低延迟 BIOS" 或 "SMI-S 免费 BIOS"。These BIOS versions are frequently referred to as "low latency BIOS" or "SMI free BIOS." 在某些情况下,硬件平台不可能完全消除 SMI 活动,因为 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 cannot control SMIs because the logical processor is running in a special maintenance mode, which prevents operating system intervention.

性能优化 TCPPerformance tuning TCP

你可以使用以下项来优化 TCP 性能。You can use the following items to tune TCP performance.

TCP 接收窗口自动优化TCP receive window autotuning

在 Windows Vista、Windows Server 2008 和更高版本的 Windows 中,Windows 网络堆栈使用名为tcp 接收窗口自动优化级别的功能来协商 tcp 接收窗口大小。In Windows Vista, Windows Server 2008, and later versions of Windows, the Windows network stack uses a feature that is named TCP receive window autotuning level to negotiate the TCP receive window size. 此功能可以在 TCP 握手期间为每个 TCP 通信协商定义的接收窗口大小。This feature can negotiate a defined receive window size for every TCP communication during the TCP Handshake.

在较早版本的 Windows 中,Windows 网络堆栈使用固定大小的接收窗口 (65535 字节) ,这会限制连接的总体可能吞吐量。In earlier versions of Windows, the Windows network stack used a fixed-size receive window (65,535 bytes) that limited the overall potential throughput for connections. TCP 连接的总可实现吞吐量可能会限制网络使用方案。The total achievable throughput of TCP connections could limit network usage scenarios. TCP 接收窗口自动优化可使这些方案完全使用网络。TCP receive window autotuning enables these scenarios to fully use the network.

对于具有特定大小的 TCP 接收窗口,可以使用以下公式来计算单一连接的总吞吐量。For a TCP receive window that has a particular size, you can use the following equation to calculate the total throughput of a single connection.

实现的总吞吐量(以字节为单位) = TCP 接收窗口大小(字节) * (1/连接延迟(以秒为单位)) Total achievable throughput in bytes = TCP receive window size in bytes * (1 / connection latency in seconds)

例如,对于滞后时间为10毫秒的连接,总可实现吞吐量只有 51 Mbps。For example, for a connection that has a latency of 10 ms, the total achievable throughput is only 51 Mbps. 对于大型企业网络基础结构,此值是合理的。This value is reasonable for a large corporate network infrastructure. 但是,通过使用自动优化调整接收窗口,连接可以实现 1 Gbps 连接的全部线路速率。However, by using autotuning to adjust the receive window, the connection can achieve the full line rate of a 1-Gbps connection.

某些应用程序定义 TCP 接收窗口的大小。Some applications define the size of the TCP receive window. 如果应用程序未定义接收窗口大小,则链接速度将确定大小,如下所示:If the application does not define the receive window size, the link speed determines the size as follows:

  • 每秒小于1兆位 (Mbps) :8千字节 (KB) Less than 1 megabit per second (Mbps): 8 kilobytes (KB)
  • 1 mbps 到 100 Mbps: 17 KB1 Mbps to 100 Mbps: 17 KB
  • 100 Mbps 到10千兆字节/秒 (Gbps) : 64 KB100 Mbps to 10 gigabits per second (Gbps): 64 KB
  • 10 Gbps 或更快: 128 KB10 Gbps or faster: 128 KB

例如,在安装了 1 Gbps 网络适配器的计算机上,窗口大小应为 64 KB。For example, on a computer that has a 1-Gbps network adapter installed, the window size should be 64 KB.

此功能还充分利用了其他功能以提高网络性能。This feature also makes full use of other features to improve network performance. 这些功能包括RFC 1323中定义的其他 TCP 选项。These features include the rest of the TCP options that are defined in RFC 1323. 通过使用这些功能,基于 Windows 的计算机可以协商较小但按定义的值进行缩放的 TCP 接收窗口大小,具体取决于配置。By using these features, Windows-based computers can negotiate TCP receive window sizes that are smaller but are scaled at a defined value, depending on the configuration. 这种情况下,更易于处理网络设备的大小。This behavior the sizes easier to handle for networking devices.

备注

你可能会遇到这样的问题:网络设备不符合RFC 1323中定义的TCP 窗口缩放选项,因此不支持缩放系数。You may experience an issue in which the network device is not compliant with the TCP window scale option, as defined in RFC 1323 and, therefore, doesn't support the scale factor. 在这种情况下,请参阅此KB 934430,当你尝试使用防火墙设备后面的 Windows Vista 时网络连接失败,或与网络设备供应商的支持团队联系。In such cases, refer to this KB 934430, Network connectivity fails when you try to use Windows Vista behind a firewall device or contact the Support team for your network device vendor.

查看和配置 TCP 接收窗口自动调谐级别Review and configure TCP receive window autotuning level

可以使用 netsh 命令或 Windows PowerShell cmdlet 来查看或修改 TCP 接收窗口自动优化级别。You can use either netsh commands or Windows PowerShell cmdlets to review or modify the TCP receive window autotuning level.

备注

与 windows 10 或 Windows Server 2019 之前的版本不同,你不能再使用注册表来配置 TCP 接收窗口大小。Unlike in versions of Windows that pre-date Windows 10 or Windows Server 2019, you can no longer use the registry to configure the TCP receive window size. 有关不推荐使用的设置的详细信息,请参阅不推荐使用的 TCP 参数For more information about the deprecated settings, see Deprecated TCP parameters.

备注

有关可用自动优化级别的详细信息,请参阅自动调谐级别For detailed information about the available autotuning levels, see Autotuning levels.

使用 netsh 查看或修改自动调谐级别To use netsh to review or modify the autotuning level

若要查看当前设置,请打开命令提示符窗口,并运行以下命令:To review the current settings, open a Command Prompt window and run the following command:

netsh interface tcp show global

此命令的输出应如下所示:The output of this command should resemble the following:

Querying active state...

TCP Global Parameters
-----
Receive-Side Scaling State : enabled
Chimney Offload State : disabled
Receive Window Auto-Tuning Level : normal
Add-On Congestion Control Provider : default
ECN Capability : disabled
RFC 1323 Timestamps : disabled
Initial RTO : 3000
Receive Segment Coalescing State : enabled
Non Sack Rtt Resiliency : disabled
Max SYN Retransmissions : 2
Fast Open : enabled
Fast Open Fallback : enabled
Pacing Profile : off

若要修改此设置,请在命令提示符下运行以下命令:To modify the setting, run the following command at the command prompt:

netsh interface tcp set global autotuninglevel=<Value>

备注

在前面的命令中, <Value> 表示自动优化级别的新值。In the preceding command, <Value> represents the new value for the auto tuning level.

有关此命令的详细信息,请参阅Interface 传输控制协议的 Netsh 命令For more information about this command, see Netsh commands for Interface Transmission Control Protocol.

使用 Powershell 查看或修改自动调谐级别To use Powershell to review or modify the autotuning level

若要查看当前设置,请打开 PowerShell 窗口并运行以下 cmdlet。To review the current settings, open a PowerShell window and run the following cmdlet.

Get-NetTCPSetting | Select SettingName,AutoTuningLevelLocal

此 cmdlet 的输出应如下所示。The output of this cmdlet should resemble the following.

SettingName           AutoTuningLevelLocal
-----------          --------------------
Automatic
InternetCustom       Normal
DatacenterCustom     Normal
Compat               Normal
Datacenter           Normal
Internet             Normal

若要修改此设置,请在 PowerShell 命令提示符下运行以下 cmdlet。To modify the setting, run the following cmdlet at the PowerShell command prompt.

Set-NetTCPSetting -AutoTuningLevelLocal <Value>

备注

在前面的命令中, <Value> 表示自动优化级别的新值。In the preceding command, <Value> represents the new value for the auto tuning level.

有关这些 cmdlet 的详细信息,请参阅以下文章:For more information about these cmdlets, see the following articles:

自动优化级别Autotuning levels

可以将接收窗口自动调谐设置为任意一种级别。You can set receive window autotuning to any of five levels. 默认级别为 "正常"。The default level is Normal. 下表介绍了这些级别。The following table describes the levels.

级别Level 十六进制值Hexadecimal value 注释Comments
标准(默认值)Normal (default) 0x8 (缩放系数 8) 0x8 (scale factor of 8) 设置 TCP 接收窗口以适应几乎所有方案。Set the TCP receive window to grow to accommodate almost all scenarios.
已禁用Disabled 没有可用的缩放比例No scale factor available 将 TCP 接收窗口设置为其默认值。Set the TCP receive window at its default value.
受限制Restricted 0x4 (缩放系数为 4) 0x4 (scale factor of 4) 设置 TCP 接收窗口,使其超出其默认值,但在某些情况下限制此类增长。Set the TCP receive window to grow beyond its default value, but limit such growth in some scenarios.
高度限制Highly Restricted 0x2 (缩放系数 2) 0x2 (scale factor of 2) 设置 TCP 接收窗口,使其超出其默认值,但要非常谨慎。Set the TCP receive window to grow beyond its default value, but do so very conservatively.
实验Experimental 0xE (比例因子 14) 0xE (scale factor of 14) 设置 TCP 接收窗口以适应极端方案。Set the TCP receive window to grow to accommodate extreme scenarios.

如果使用应用程序来捕获网络数据包,则应用程序应为不同的窗口自动优化级别设置报告类似于以下内容的数据。If you use an application to capture network packets, the application should report data that resembles the following for different window autotuning level settings.

  • 自动调谐级别:**正常 (默认状态) **Autotuning level: Normal (default state)

    Frame: Number = 492, Captured Frame Length = 66, MediaType = ETHERNET
    + Ethernet: Etype = Internet IP (IPv4),DestinationAddress:[D8-FE-E3-65-F3-FD],SourceAddress:[C8-5B-76-7D-FA-7F]
    + Ipv4: Src = 192.169.0.5, Dest = 192.169.0.4, Next Protocol = TCP, Packet ID = 2667, Total IP Length = 52
    - Tcp: [Bad CheckSum]Flags=......S., SrcPort=60975, DstPort=Microsoft-DS(445), PayloadLen=0, Seq=4075590425, Ack=0, Win=64240 ( Negotiating scale factor 0x8 ) = 64240
    SrcPort: 60975
    DstPort: Microsoft-DS(445)
    SequenceNumber: 4075590425 (0xF2EC9319)
    AcknowledgementNumber: 0 (0x0)
    + DataOffset: 128 (0x80)
    + Flags: ......S. ---------------------------------------------------------> SYN Flag set
    Window: 64240 ( Negotiating scale factor 0x8 ) = 64240 ---------> TCP Receive Window set as 64K as per NIC Link bitrate. Note it shows the 0x8 Scale Factor.
    Checksum: 0x8182, Bad
    UrgentPointer: 0 (0x0)
    - TCPOptions:
    + MaxSegmentSize: 1
    + NoOption:
    + WindowsScaleFactor: ShiftCount: 8 -----------------------------> Scale factor, defined by AutoTuningLevel
    + NoOption:
    + NoOption:
    + SACKPermitted:
    
  • 自动调谐级别:已禁用Autotuning level: Disabled

    Frame: Number = 353, Captured Frame Length = 62, MediaType = ETHERNET
    + Ethernet: Etype = Internet IP (IPv4),DestinationAddress:[D8-FE-E3-65-F3-FD],SourceAddress:[C8-5B-76-7D-FA-7F]
    + Ipv4: Src = 192.169.0.5, Dest = 192.169.0.4, Next Protocol = TCP, Packet ID = 2576, Total IP Length = 48
    - Tcp: [Bad CheckSum]Flags=......S., SrcPort=60956, DstPort=Microsoft-DS(445), PayloadLen=0, Seq=2315885330, Ack=0, Win=64240 ( ) = 64240
    SrcPort: 60956
    DstPort: Microsoft-DS(445)
    SequenceNumber: 2315885330 (0x8A099B12)
    AcknowledgementNumber: 0 (0x0)
    + DataOffset: 112 (0x70)
    + Flags: ......S. ---------------------------------------------------------> SYN Flag set
    Window: 64240 ( ) = 64240 ----------------------------------------> TCP Receive Window set as 64K as per NIC Link bitrate. Note there is no Scale Factor defined. In this case, Scale factor is not being sent as a TCP Option, so it will not be used by Windows.
    Checksum: 0x817E, Bad
    UrgentPointer: 0 (0x0)
    - TCPOptions:
    + MaxSegmentSize: 1
    + NoOption:
    + NoOption:
    + SACKPermitted:
    
  • 自动调谐级别:受限Autotuning level: Restricted

    Frame: Number = 3, Captured Frame Length = 66, MediaType = ETHERNET
    + Ethernet: Etype = Internet IP (IPv4),DestinationAddress:[D8-FE-E3-65-F3-FD],SourceAddress:[C8-5B-76-7D-FA-7F]
    + Ipv4: Src = 192.169.0.5, Dest = 192.169.0.4, Next Protocol = TCP, Packet ID = 2319, Total IP Length = 52
    - Tcp: [Bad CheckSum]Flags=......S., SrcPort=60890, DstPort=Microsoft-DS(445), PayloadLen=0, Seq=1966088568, Ack=0, Win=64240 ( Negotiating scale factor 0x4 ) = 64240
    SrcPort: 60890
    DstPort: Microsoft-DS(445)
    SequenceNumber: 1966088568 (0x75302178)
    AcknowledgementNumber: 0 (0x0)
    + DataOffset: 128 (0x80)
    + Flags: ......S. ---------------------------------------------------------> SYN Flag set
    Window: 64240 ( Negotiating scale factor 0x4 ) = 64240 ---------> TCP Receive Window set as 64K as per NIC Link bitrate. Note it shows the 0x4 Scale Factor.
    Checksum: 0x8182, Bad
    UrgentPointer: 0 (0x0)
    - TCPOptions:
    + MaxSegmentSize: 1
    + NoOption:
    + WindowsScaleFactor: ShiftCount: 4 -------------------------------> Scale factor, defined by AutoTuningLevel.
    + NoOption:
    + NoOption:
    + SACKPermitted:
    
  • 自动调谐级别:高度限制Autotuning level: Highly restricted

    Frame: Number = 115, Captured Frame Length = 66, MediaType = ETHERNET
    + Ethernet: Etype = Internet IP (IPv4),DestinationAddress:[D8-FE-E3-65-F3-FD],SourceAddress:[C8-5B-76-7D-FA-7F]
    + Ipv4: Src = 192.169.0.5, Dest = 192.169.0.4, Next Protocol = TCP, Packet ID = 2388, Total IP Length = 52
    - Tcp: [Bad CheckSum]Flags=......S., SrcPort=60903, DstPort=Microsoft-DS(445), PayloadLen=0, Seq=1463725706, Ack=0, Win=64240 ( Negotiating scale factor 0x2 ) = 64240
    SrcPort: 60903
    DstPort: Microsoft-DS(445)
    SequenceNumber: 1463725706 (0x573EAE8A)
    AcknowledgementNumber: 0 (0x0)
    + DataOffset: 128 (0x80)
    + Flags: ......S. ---------------------------------------------------------> SYN Flag set
    Window: 64240 ( Negotiating scale factor 0x2 ) = 64240 ---------> TCP Receive Window set as 64K as per NIC Link bitrate. Note it shows the 0x2 Scale Factor.
    Checksum: 0x8182, Bad
    UrgentPointer: 0 (0x0)
    - TCPOptions:
    + MaxSegmentSize: 1
    + NoOption:
    + WindowsScaleFactor: ShiftCount: 2 ------------------------------> Scale factor, defined by AutoTuningLevel
    + NoOption:
    + NoOption:
    + SACKPermitted:
    
  • 自动调谐级别:实验Autotuning level: Experimental

    Frame: Number = 238, Captured Frame Length = 66, MediaType = ETHERNET
    + Ethernet: Etype = Internet IP (IPv4),DestinationAddress:[D8-FE-E3-65-F3-FD],SourceAddress:[C8-5B-76-7D-FA-7F]
    + Ipv4: Src = 192.169.0.5, Dest = 192.169.0.4, Next Protocol = TCP, Packet ID = 2490, Total IP Length = 52
    - Tcp: [Bad CheckSum]Flags=......S., SrcPort=60933, DstPort=Microsoft-DS(445), PayloadLen=0, Seq=2095111365, Ack=0, Win=64240 ( Negotiating scale factor 0xe ) = 64240
    SrcPort: 60933
    DstPort: Microsoft-DS(445)
    SequenceNumber: 2095111365 (0x7CE0DCC5)
    AcknowledgementNumber: 0 (0x0)
    + DataOffset: 128 (0x80)
    + Flags: ......S. ---------------------------------------------------------> SYN Flag set
    Window: 64240 ( Negotiating scale factor 0xe ) = 64240 ---------> TCP Receive Window set as 64K as per NIC Link bitrate. Note it shows the 0xe Scale Factor.
    Checksum: 0x8182, Bad
    UrgentPointer: 0 (0x0)
    - TCPOptions:
    + MaxSegmentSize: 1
    + NoOption:
    + WindowsScaleFactor: ShiftCount: 14 -----------------------------> Scale factor, defined by AutoTuningLevel
    + NoOption:
    + NoOption:
    + SACKPermitted:
    

不推荐使用的 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.

  • TcpWindowSizeTcpWindowSize
  • NumTcbTablePartitionsNumTcbTablePartitions
  • MaxHashTableSizeMaxHashTableSize

所有这些设置都位于以下注册表子项中:All of these settings were located in the following registry subkey:

HKEY_LOCAL_MACHINE \System\CurrentControlSet\Services\Tcpip\ParametersHKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Tcpip\Parameters

Windows 筛选平台Windows Filtering Platform

Windows Vista 和 Windows Server 2008 在 WFP) (引入了 Windows 筛选平台。Windows Vista and Windows Server 2008 introduced the Windows Filtering Platform (WFP). WFP 向非 Microsoft 独立软件供应商提供 Api (Isv) 来创建数据包处理筛选器。WFP 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. 有关详细信息,请参阅 Windows 开发人员中心中的将包处理驱动程序和应用程序移植到 WFPFor 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.