Introduction
Optimizing network performance on Windows requires understanding the stack, configuring the right parameters, and leveraging built‑in tools. This guide provides best practices, tunable settings, and sample code to help you maximize throughput and minimize latency.
Tuning Guidelines
- Enable
TCP Chimney Offloadfor high‑throughput servers. - Adjust
Auto-Tuning Levelvianetsh interface tcp set global autotuninglevel=highlyrestricted. - Use
Receive Window Auto-Tuningto allow dynamic scaling.
- Increase
MaxUserPortfor large numbers of outbound connections. - Configure
TcpTimedWaitDelayto reduce TIME_WAIT hold time.
Key Metrics
Time to First Byte (TTFB)
Round‑Trip Time (RTT)
Packet Loss Rate
Throughput (Mbps)
Latency (ms)
Performance Tools
- Performance Monitor (PerfMon) – Track
TCPv4\Segments/sec,Network Interface\Bytes Total/sec. - Network Monitor / Message Analyzer – Capture packets for detailed analysis.
- Windows Performance Recorder (WPR) – Collect trace data for TCP/IP stack.
Code Samples
// Sample: Adjust TCP Auto‑Tuning Level (PowerShell)
netsh interface tcp set global autotuninglevel=experimental
// Sample: Retrieve current TCP settings (C#)
using System;
using System.Net.NetworkInformation;
class TcpInfo {
static void Main() {
var properties = IPGlobalProperties.GetIPGlobalProperties();
Console.WriteLine($"Hostname: {properties.HostName}");
Console.WriteLine($"Domain: {properties.DomainName}");
}
}
FAQ
Run netsh interface tcp show global and check Receive Side Scaling and TCP Chimney Offload values.
Adjusting TcpAckFrequency can reduce acknowledgment delay, improving latency for interactive workloads.