When deploying SharePoint in enterprise environments, Microsoft recommends maintaining network latency below 1ms between web front-end servers and database servers. Excessive latency directly impacts:
- Page load times
- Authentication performance
- Database query execution
- Search index propagation
While ping is the most basic tool, professionals need multiple measurement methods:
1. PowerShell Test-Connection (Advanced Ping)
# Continuous latency monitoring with statistics
Test-Connection -ComputerName SQLServer01 -Count 100 -Delay 2 |
Measure-Object -Property ResponseTime -Average -Maximum -Minimum |
Format-Table -AutoSize
# Output sample:
# Average Maximum Minimum
# ------- ------- -------
# 0.78 1.2 0.4
2. Windows Performance Monitor Counters
Essential counters for SharePoint latency analysis:
Network Interface(*)\Current Bandwidth
Network Interface(*)\Output Queue Length
TCPv4\Connections Established
TCPv4\Connection Failures
3. Latency Breakdown with PathPing
pathping -q 50 -w 1000 -4 SQLServer01
# -q : Number of queries per hop
# -w : Timeout in milliseconds
# -4 : Force IPv4 (recommended for SharePoint)
Synthetic Transaction Monitoring
# Measure SQL query roundtrip time
$sw = [System.Diagnostics.Stopwatch]::StartNew()
$conn = New-Object System.Data.SqlClient.SqlConnection
$conn.ConnectionString = "Server=SQLServer01;Database=SharePoint_Config;Integrated Security=True"
$conn.Open()
$sw.Stop()
Write-Output ("Connection Latency: " + $sw.ElapsedMilliseconds + "ms")
Wireshark Analysis for Microsecond Precision
Filter for SharePoint-specific traffic:
(tcp.port == 1433 || tcp.port == 50288) && (tcp.analysis.ack_rtt > 0.001)
Sample script for scheduled monitoring:
$threshold = 1 #ms
$result = Test-Connection -ComputerName SQLServer01 -Count 1 -ErrorAction SilentlyContinue
if ($result.ResponseTime -gt $threshold) {
# Trigger alert logic
Write-EventLog -LogName "Application" -Source "SharePoint" -EntryType Warning -EventId 5001
-Message "Network latency exceeded threshold: $($result.ResponseTime)ms"
}
-- SQL Server roundtrip test
DECLARE @start DATETIME2 = SYSUTCDATETIME()
EXEC sp_executesql N'SELECT TOP 1 * FROM [SharePoint_Config].[dbo].[Objects]'
SELECT DATEDIFF(MICROSECOND, @start, SYSUTCDATETIME())/1000.0 AS ExecutionLatencyMs
Key patterns to investigate:
- Consistent latency >0.8ms during business hours
- Jitter (variance) >0.3ms between measurements
- Retransmissions in TCP streams
- ICMP vs TCP latency discrepancies
When deploying SharePoint, Microsoft recommends keeping network latency between web servers and SQL database servers under 1ms for optimal performance. This strict requirement ensures smooth operation of real-time collaboration features and prevents bottlenecks in database transactions.
While ping
is the most basic tool, it has limitations for precise SharePoint measurements:
ping -n 100 -l 8 your_database_server
This sends 100 ICMP packets with 8-byte payloads, but doesn't account for TCP-level latency that SharePoint actually uses.
For SharePoint-specific monitoring, add these Performance Monitor counters:
\Network Interface(*)\Current Bandwidth
\TCPv4\Connections Established
\Network Interface(*)\Output Queue Length
\TCPv4\RTT
\TCPv4\Connect Failures
This script measures TCP latency more accurately than ping:
# SharePoint TCP Latency Test
$server = "your_database_server"
$port = 1433 # Default SQL port
$iterations = 100
$results = @()
for ($i=1; $i -le $iterations; $i++) {
$tcpClient = New-Object System.Net.Sockets.TcpClient
$timer = [System.Diagnostics.Stopwatch]::StartNew()
$tcpClient.Connect($server, $port)
$timer.Stop()
$results += $timer.Elapsed.TotalMilliseconds
$tcpClient.Close()
}
$results | Measure-Object -Average -Maximum -Minimum
Windows 10/Server 2016+ includes this useful cmdlet:
Test-NetConnection -ComputerName your_database_server -Port 1433 -InformationLevel Detailed
When reviewing latency data:
- Consistent spikes may indicate network congestion
- Values >1ms require investigation for SharePoint deployments
- Check for correlation with SharePoint ULS logs
For production environments, configure this Data Collector Set in perfmon:
- Create new Data Collector Set
- Add the TCPv4 and Network Interface counters mentioned above
- Set sample interval to 15 seconds
- Configure alerts for latency >0.8ms