Powershell script to generate file read/write activity to test storage performance

This script generates file read/write activity to test storage performance. Set the $WorkFolder and $MaxSpaceToUseOnDisk variables on top to indicate the folder where test files will be created and maximum amount of disk space to be used on $WorkFolder during testing respectively.

The script can be run with the -verbose switch to show more information during processing, like:

.\busy2.ps1 -verbose

As the $WorkFolder exceed 90% of the capacity indicated by the $MaxSpaceToUseOnDisk variable, the scripts deletes all test files and starts a new cycle. the script can be stopped by clicking CTRL-C or setting the registry key HKLM:\Software\Microsoft\Busy to 0

The script includes a recursive function to generate seed files of (decimal) exponential sizes to be used for file copy activities.

The script generates 2 log files. The first one has details on the files created. The second one is a CSV file that has a record for every cycle the script goes through, including cycle duration, sum of generated file sizes, number of files generated on this cycle, average file size, disk throughput, IOPS,…

Here’s an example CSV file output:

Cycle # Duration (sec) Files (GB) # of Files Avg. File (MB) Throughput (MB/s) IOPS (K) Machine Name Start Time End Time
1 337.67 95.35 19 5138.85 289.15 4.63 HV-LAB-05 07/10/2014 19:54 07/10/2014 20:00

The script can be downloaded from the Microsoft TechNet Gallery.



Version 1.2 is here

The script displays output to the screen like:

It also logs the same to a text file like Busy_HV-LAB-05.txt and enters the statistics in a CSV file like Busy_HV-LAB-05.csv


Leave a Reply

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

WordPress.com Logo

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

Google+ photo

You are commenting using your Google+ 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

This site uses Akismet to reduce spam. Learn how your comment data is processed.