I am trying to create a very simple batch script to make high usage of CPU and disk with low memory(RAM) footprint.
The purpose is to make the system very slow to test and fix some timeout exceptions issues.
For high CPU usage, I am able to achieve it with this simple batch script and running 4-5 instances of it.
@echo off :loop goto loop
I modified the script to do some read-write operations as well to get high disk usage, but despite I am running multiple instances I am still getting almost 0% disk usage with my SSD disk. Below is my modified script –
@echo off :loop set file=D:\text%random%.txt FOR /L %%A IN (1,1,20) DO (ECHO This is garbage text. >> %file%) del %file% goto loop
Any suggestions how to increase the disk usage.
- My task would be done if I can make CPU and disk usage high, but I would be curious to know how to increase memory usage as well.
- I understand that complex solution like lots of zip/unzip using Powershell and 7Zip, etc may work. But I want to achieve this as simple as possible without using any 3rd party tools (Burn tests).
- I can use PowerShell as well, provided without any 3rd party tools.
As suggested by @Squashman, I found Diskspd Utility fulfilling my requirement.
Running the single instance of this simple command made my disk usage to 100% and CPU usage to 50%.
Diskspd.exe -b8K -d60 -h -L -o2 -t4 -r -w30 -c50M c:\io.dat
My System Config:
CPU : Intel Core i7-6600U 2.81Ghz
Ram : 16 Gigs
Answered By – Koder101
Answer Checked By – Senaida (BugsFixing Volunteer)