Install stress Command on Raspberry Pi

Install stress Command on Raspberry Pi

The stress is a command line tool that allows to generate a workload on the system. This tool enables to configure amount of load on CPU, memory, and I/O.

This tutorial explains how to install stress on Raspberry Pi.

Connect to Raspberry Pi via SSH. Execute the following commands to update the package lists and install stress:

sudo apt update
sudo apt install -y stress

Once installed, we can check version of stress:

stress --version

Run the stress command with a --cpu option followed by number of workers to perform CPU stress testing. With a --cpu option, a workload is generated by using sqrt function. The --timeout option stops stress testing after N seconds.

The uptime command can be used to determine the average system load before and after running a stress command.

uptime
sudo stress --cpu 2 --timeout 10
uptime

Example of the output:

CPU Stress Testing Using stress Command on Raspberry Pi

If the stress is no longer needed, you can completely remove it with command:

sudo apt purge --autoremove -y stress

Leave a Comment

Cancel reply

Your email address will not be published.