I would like to stress test a website using wget commands. How to concurrently run 40 wget commands in Microsoft Windows environment?
I have tried writing command script but the wget command will be triggered one by one.
I would like to stress test a website using wget commands. How to concurrently run 40 wget commands in Microsoft Windows environment?
I have tried writing command script but the wget command will be triggered one by one.
You can use for /L
to run a loop 40 times, and start
to launch the program without waiting. From the command line:
for /L %a in (1 1 40) do start wget the_url
From a batch file, you would use the same command, except use %%a
instead of %a
Because wget is a command-line program, you will see 40 new console windows open up, which should close automatically as the wget commands finish. You can avoid this by using start /b
to run the commands all in the same console. In this case, I would also pipe the output of each command to NUL, to avoid having forty instances writing to the same console.
for /L %a in (1 1 40) do start /b wget the_url >nul
Use the &
operator along with the start
command:
C:\> start wget URL1 & start wget URL2 & start wget URL3.....