Ubuntu – command or a serie of commands to make the computer use as much resources as possible

command lineresourcesUbuntu

I am looking for one or possibly more commands, or a combination of commands, to get my PC to use as much resources as possible.

I want to check how my computer behaves when subject to the maximum amount of data it can handle.

I've tried by running multiple programs such as browsers, graphic and system tools one by one and all together, I've also tried to download big files to monitor its network and storage performance but every time depending on what program(s) I run, I get different results in terms of RAM, CPU, I/O.

Often my whole system crashes and I have to reboot or struggle to close some programs. To monitor, I'm using different commands such as iostat, iotop, htop, vmstat, lsof, iftop, iptraf but also some other little programs. (I'm using ubuntu)

I would very much appreciate an answer that could list some way to exploit GPU, CPU and RAM and a way to write a file (even with zeros) in the quickest way possible to see how fast my computer can produce output and write it on the HDD.

Best Answer

You could probably use stress:

stress: tool to impose load on and stress test systems

If you wnat to stress memory you could use :

stress  --vm 2 --vm-bytes 512M --timeout 10s 

to use 2 vm using both 512MB of ram for 10 seconds.
If you want to stress CPU add:

stress --cpu ## -t 10s

with ## equal to your number of core to simulate a 100% cpu usage on all core at the same time for 10 seconds.
and if you want to simulate IO use the option :

stress --io 4 -t 10s

It will add thread that do sync call to you disk but you could also write to your disk with this option:

stress --hdd 4 --hdd-bytes 256M 

This would create 4 thread writing each 256 MB of data to your disk, this could of course adjusted to simulated either lots of small file write or huge file write.

This will need some adaptation form you if you wan to stress thing one by one or all together or for longer time like this:

  stress --hdd 4 --hdd-bytes 256M --io 4 --cpu ## --vm 2 --vm-bytes 512M -t 60s

As for the GPU you could use glmark2 which should be available in Ubuntu. It's a basic GPU benchmark you could run it forever to simulate a gpuload:

glmark2 --run-forever
Related Question