Increase load with stress command in Linux [Cheat Sheet]

Rohan Timalsina


Introduction to stress command

stress is a command-line tool in Linux that allows you to load and stress a computer system. It imposes certain types of computing stress such as CPU, memory, I/O, and disk stress on the machine.


How to install stress

You can install stress using the following commands according to your Linux distribution.

Install stress on CentOS, RHEL, Fedora

$ sudo dnf install stress


Install stress on Ubuntu and Debian

$ sudo apt install stress


Syntax to use stress command

The syntax for stress command is as follows:

$ stress [OPTION [ARG]]

Some options available in stress command are:

  • --cpu: spawn workers spinning on sqrt()
  • --io: spawn workers spinning on sync()
  • --vm: spawn workers spinning on malloc()/free()
  • -t: timeout after N seconds


Different examples to use stress command

1. Increase CPU Load

The -c or --cpu option uses a given number of workers on sqrt() function to increase the CPU load and make it work harder.

$ stress -c N


$ stress --cpu N

Sample Output:

The following command will load 4 CPU cores continuously.

$ stress --cpu 4

Increase load with stress command in Linux [Cheat Sheet]


2. Provide timeout for stress

To stress for a specific time, you can use -t or --timeout option.

The following commands will stress four CPU cores for 10s only.

$ stress -c 4 -t 10


$ stress --cpu 4 --timeout 10


3. Increase Memory Load

The -v or --vm option allows you to stress a virtual memory.

$ stress -v N


$ stress --vm N

Sample Output:

The top command output shows the high VIRT and RES memory. Read more at Beginners guide on linux memory management and How to check memory usage per process in Linux

increase memory load


4. Increase Disk I/O Load

You can increase I/O load using the -i or --io option.

$ stress -i N


$ stress --io N

Sample Output:

The following example generates a load on the system using two I/O-bound processes.

# stress --io 100

We will check the disk IO load using iostat command. I have /dev/vda and /dev/vdb disk available on my server, you can check your active disk using lsblk or fdisk or any other preferred command. If you execute this command without any argument then it will show disk IO for all the available disks.

# iostat -d /dev/vda -d /dev/vdb 1

Increase load with stress command in Linux [Cheat Sheet]

Read More:
14 iotop command examples [Monitor Disk IO]
Top 15 tools to monitor disk IO performance with examples
How to improve disk IO performance in Linux


5. Increase Load on Disk

The -d or --hdd option is used to create stress on the disk.

$ stress -d N


$ stress --hdd N

Sample Output:

We will use following command to increase stress on the disk

# stress --hdd 100

Monitor the disk throughput using vmstat command:

# vmstat 1 100

Increase load with stress command in Linux [Cheat Sheet]


6. Increase Load on multiple system resources (CPU, Memory, I/O)

You can specify multiple loads to the stress command. The following example uses 4 CPU cores, 2 virtual memory, and 1 I/O-bound process to stress the system for 20 seconds.

$ stress --cpu 4 --vm 2 --io 1 -t 20

Sample Output:

stress command in linux



Now you should know how to use stress command and generate computing stress on the Linux system. If you have any confusion regarding this article, do let us know via comments.


What's Next

15+ iostat command examples in Linux [Cheat Sheet]
10+ vmstat command examples in Linux [Cheat Sheet]


Further Reading

man page for stress command


Views: 307

Rohan Timalsina

He is proficient in a wide range of skills, including Page Builder Plugins such as Elementor, Beaver Builder, Visual Composer, and Divi Builder. His expertise extends to Front End Development with HTML5/CSS3, JavaScript, Bootstrap, and React.js. You can reach out to him on LinkedIn or check his projects on GitHub page.

Can't find what you're searching for? Let us assist you.

Enter your query below, and we'll provide instant results tailored to your needs.

If my articles on GoLinuxCloud has helped you, kindly consider buying me a coffee as a token of appreciation.

Buy GoLinuxCloud a Coffee

For any other feedbacks or questions you can send mail to

Thank You for your support!!

2 thoughts on “Increase load with stress command in Linux [Cheat Sheet]”

  1. Running a remote server via ssh on ubuntu desktop:

    Unable to use the timeout argument.
    It says, stress: error: unrecognized arguments: -t 5 or –timeout 5
    Could you please resolve it

    • It seems to be working for me with stress_1.0.5-1_amd64.deb.

      root@deepak-VirtualBox:~# stress -c 4 -t 10
      stress: info: [6382] dispatching hogs: 4 cpu, 0 io, 0 vm, 0 hdd
      root@deepak-VirtualBox:~# lsb_release -a
      No LSB modules are available.
      Distributor ID:	Ubuntu
      Description:	Ubuntu 22.04.1 LTS
      Release:	22.04
      Codename:	jammy

Leave a Comment

We try to offer easy-to-follow guides and tips on various topics such as Linux, Cloud Computing, Programming Languages, Ethical Hacking and much more.

Programming Languages