Skip to content

Instantly share code, notes, and snippets.

@EvilFaeton
Created June 7, 2012 06:27
Show Gist options
  • Save EvilFaeton/2886922 to your computer and use it in GitHub Desktop.
Save EvilFaeton/2886922 to your computer and use it in GitHub Desktop.
Simulate heavy load CPU and IO on Linux
# CPU
for cpu in 1 2 ; do
( while true; do true; done ) &
done
# IO
for cpu in 1 2 ; do
( while true; do find / -type f -exec cp {} /dev/null \; ; done ) &
done
# use 1 2 3 4 for quad core, etc.
@bishopb
Copy link

bishopb commented Mar 9, 2016

Might also like:

$ echo $(seq 1 $(nproc))
1 2 3 4

@vankaur19
Copy link

do find ./ -type f ..

The ./ instead of / was what got the code to run for me. But thank you for this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment