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:
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.
The script displays output to the screen like: