This article describes a method for performing throughput tests of uploads and downloads to and from CentreStack using the CentreStack REST APIs.
This PowerShell script can be used to test the throughput of the CentreStack REST APIs:
The script is capable of uploading/downloading to/from CentreStack. 2 GB is the largest file that may be uploaded or downloaded by the script.
- Make sure scripts are allowed to run. Execute:
- Change to the directory where the scripts were downloaded for example:
- Unblock the file because it was downloaded from the Internet:
- To view all comment based help, including syntax and examples, execute:
Get-Help .\Copy-CSFile.ps1 -Full
Upload a file
Execute a command similar to this example:
.\Copy-CSFile.ps1 -Action Upload -UserName email@example.com -URL https://centrestack.acmedrive.com -LocalFile C:\ISOs\vmguest.iso -RemoteFile /Documents/ISOs/vmguest.iso
The script will prompt for a password. Enter the password of the user account specified with the -UserName parameter.
The command line arguments for this example are explained as follows:
- -Action Upload
Instructs the script to upload the local file to CentreStack
- -UserName firstname.lastname@example.org
A user account on the CentreStack server named email@example.com
- -URL https://centrestack.acmedrive.com
The URL of a hypothetical CentreStack server
- -LocalFile C:\ISOs\vmguest.iso
The local file to be uploaded to the CentreStack server
- -RemoteFile /Documents/ISOs/vmguest.iso
The path to a file that will be created (or overwritten) on the CentreStack server. In this case the file is being uploaded to the user's /Documents/ISOs directory.
While the file is being uploaded the script will not show any progress and may look like it is hung. Have patience as a very large file may take minutes to upload. Once the upload is complete, the script will output statistics such as:
Downloaded 1,907,568 KB in: 0:02:54.5634798
Throughput: 11,189,910.021 Bytes/sec
Throughput: 10,927.647 KiloBytes/sec
Throughput: 85.372 Megabits/sec
Throughput: 640.292 MegaBytes/min
Extrapolated Throughput: 37.517 GigaBytes/hour
Download a file
Downloading a file is nearly identical to uploading a file, only the -Action parameter is changed to 'Download' (as opposed to 'Upload'). Execute a command similar to this example:
.\Copy-CSFile.ps1 -Action Download -UserName firstname.lastname@example.org -URL https://centrestack.acmedrive.com -LocalFile C:\ISOs\vmguest.iso -RemoteFile /Documents/ISOs/vmguest.iso
The script will prompt for the CentreStack user's password.
The other parameters are the same as the upload example. However when performing a download, the file specified with the -LocalFile parameter will be created (or overwritten).
- Don't use a file larger than 2 GB. The script will throw an error as this is unsupported.
- Start with very small file before testing files as large as 2 GB.
- Upload a file first, then download the same file to a different directory than the original local file. In other words, change the path in the -LocalFile parameter for the Download Action. Use the fc.exe command line utility to compare the original local file to the downloaded file. They must match exactly.
- Compare the throughput results with an Internet speed test such as Google's, AT&T's or Ookla's. The throughput results should be similar. In other words, your Internet bandwidth at the client and server tend to be the bottleneck.
- Another test you could perform would be to expose the CentreStack's SMB port (TCP 445) to the client's public IP and use robocopy.exe to test the throughput. You could use a command similar to this to upload one file (vmguest.iso) using robocopy:
robocopy.exe c:\ISOs Z:\ vmguest.isoWhere "C:\ISOs" is the local source folder, "Z:\" is a network drive connected to a CIFS share on the CentreStack server, and "vmguest.iso" is the file to upload.