Script to find file transfer time

There are a  lot of components that affect the file transfer speeds over a network and it is just not just only the network speed. The bottleneck is usually going to be the storage because disk have a maximum  transfer rate that could be lower than you network speed. For example a  1Gb network would give you a rate 0f 125mbps, this mean that a 1Gb file would take close to 8 seconds to be transfer between 2 nodes. Now if your node or server  has a mechanical drive that gives you around 50mpbs max, That means that 1Gb transfer file would take around 3 minutes  instead of 8 seconds.

Let me give you a couple of recommendations if you want to maximize file transfer between servers.

  1. If you have 10Gb infrastructure make use of it. The transfer rate is around 1.25Gbps
  2. Do not use the onboard NICs. The reason being is that also affects the transfer speeds. Use the PCI Express expansion card on the node or server.
  3. You can change settings on the NIC to improve the transfer rate such as buffer size, RSS(Only works with multiple Nics), use Jumbo frames (for this to work properly the settings needs to be set on the switch), hard code the speed on the NIC. I would recommend SolarFlare network cards.
  4. Add more NICs so parallel file transfer can be utilize
  5. Windows 2012 R2 navitely can use RDMA (Remote Direct Memory Access) . You may need to do some configuration on the network.
  6. You want to use a modern operation system like Windows 2012 R2. The reason being is take advantage on the SMB 3.0 protocol. You can read this blog for more information here

Now if you need to calculate how long would it take to transfer a file I have written a small function to calculate based on 1Gb, 10GB and 40Gb network.

function Get-TransferTime
Begin {
[decimal]$1Gb = 0.125
[decimal]$1Mb = 0.0125
[long]$10Gb = 1.250
[int]$40Gb = 5
[long]$100Gb = 12.5
Process {
if($FileSizeTb) {
[decimal]$FileSize = $FileSizeTb * 1000
else {
[decimal]$FileSize = $FileSizeGb
$Time1Gb = $FileSize / $1Gb
$Time10Gb = $FileSize / $10Gb
$Time40Gb = $FileSize / $40Gb
$Time100Gb = $FileSize / $100Gb
$Time1Gb = New-TimeSpan -Seconds $Time1Gb
$Time10Gb = New-TimeSpan -Seconds $Time10Gb
$Time40Gb = New-TimeSpan -Seconds $Time40Gb
$Time100Gb = New-TimeSpan -Seconds $Time100Gb
$Time1Gb = $Time1Gb | Select-Object days, hours, minutes, seconds
$Time10Gb = $Time10Gb | Select-Object days, hours, minutes, seconds
$Time40Gb = $Time40Gb | Select-Object days, hours, minutes, seconds
End {
Write-Output "`n To Transfer $FileSize GB over a 1GB network, will take $Time1Gb"
Write-Output "`n To Transfer $FileSize GB over a 10GB network, will take $Time10Gb"
Write-Output "`n To Transfer $FileSize GB over a 40GB network, will take $Time40Gb"

view raw


hosted with ❤ by GitHub

Now lets do a couple of examples

How long would it take 1GB to transfer from one node to another on perfect conditions

Get-TransferTime -FileSizeGb 1


1Gb Network -> 8 seconds

10Gb Network-> 1 second

40Gb Network -> less than 1 second



1Gb Network -> 1 minute and 20 seconds

10Gb Network-> 10 seconds

40Gb Network -> 2 seconds



Get-TransferTime -FileSizeTb 1


1Gb Network -> 2 hours and 13 minutes

10Gb Network-> 16 minutes

40Gb Network -> 3 minutes and 20 seconds



Get-TransferTime -FileSizeTb 10


1Gb Network -> 22 hours and 13 minutes

10Gb Network-> 2 hours and 46 minutes

40Gb Network -> 33 minutes and 20 seconds


The key thing here is that you need to pay attention to the whole infrastructure to maximize transfer speed. Keep in mind if you want to have faster, and secure file transfers is super important to use modern operating systems like Windows 2012 R2 and use enhanced protocols like SMB 3.X

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s