Quantcast
Channel: Microsoft – JeffOps
Viewing all articles
Browse latest Browse all 120

PowerShell – Find the appropriate network packet (MTU) size

$
0
0

While working with the SQL guys from my current customer, we found that we needed to know which MTU size we could configure.
To understand what MTU size, or packet size, are and how they can impact SQL Server, I suggest you do some serious homework.
Changes in this can greatly impact the performance of SQL Server, both in a positive and negative way.

Oh well, here’s a script that will help you get an MTU value based on the network configuration you have in your environment (routers, switches, NICs, etc.):

$UpperBoundPacketSize = 4096
do {
    Write-Output "Testing packet size $UpperBoundPacketSize"
    $PingOut = ping $IpToPing -n 1 -l $UpperBoundPacketSize -f
    $UpperBoundPacketSize -= 1
} while ($PingOut[2] -like "*fragmented*")

$UpperBoundPacketSize += 1
$Mtu = $UpperBoundPacketSize + 28

New-Object -TypeName PSObject -Property @{
    MTU = $MTU
}


Viewing all articles
Browse latest Browse all 120

Trending Articles