Raspberry Pi Stress Test Monitor
by ÁlvaroM13 in Circuits > Raspberry Pi
25 Views, 0 Favorites, 0 Comments
Raspberry Pi Stress Test Monitor
In this project, you will learn how to create a simple stress test monitor for a Raspberry Pi.
The goal is to check how your Raspberry Pi behaves under heavy CPU load, while monitoring temperature and possible throttling events.
This is useful when testing:
- different Raspberry Pi cases;
- heatsinks;
- active cooling fans;
- power supplies;
- classroom projects;
- kiosks;
- small servers;
AI or computer vision setups.
By the end of this project, you will be able to run a stress test, monitor the CPU temperature, and check whether your Raspberry Pi has reduced performance because of heat or power issues.
Warning: during the test, make sure the Raspberry Pi has good ventilation and a suitable power supply.
Recommendation for Raspberry Pi 5: use an active cooler or a case with a fan, especially for long tests or computer vision projects.
Supplies
Hardware
- Raspberry Pi 4 or Raspberry Pi 5
- microSD card with Raspberry Pi OS
- Official or good-quality power supply
- Internet connection
- Keyboard, mouse and monitor, or SSH access
Optional
- Heatsink
- Fan
- Raspberry Pi case
- Active Cooler for Raspberry Pi 5
Software
- Raspberry Pi OS
- Terminal
- stress-ng
- vcgencmd
Update Raspberry Pi OS
Open the terminal and update your Raspberry Pi:
This makes sure your system is up to date before installing the stress test tool.
Install Stress-ng
Install stress-ng with the following command:
stress-ng is a tool used to put load on the CPU, memory and other parts of the system.
Check the Initial Temperature
Before starting the test, check the current CPU temperature:
Example output:
Write down this value. It will help you compare the temperature before and after the stress test.
Check the Initial Throttling Status
Run:
If everything is normal, you should see:
This means that no throttling has been detected.
Throttling can happen when the Raspberry Pi becomes too hot or when the power supply is not strong enough.
The result was:
This means that the Raspberry Pi had already reached a performance limit since the last boot.
In this case, the code 0xe0000 indicates that:
- ARM frequency capping has occurred;
- throttling has occurred;
- the soft temperature limit has been reached.
This does not necessarily mean that the Raspberry Pi is throttling at the exact moment of the check. It means that throttling happened at some point since the last reboot. Since my Raspberry Pi was running without any heatsink, fan or active cooler, this result was expected. Under stress, the board heats up and automatically reduces performance to protect itself.
Run a CPU Stress Test
Now run a simple CPU stress test:
Explanation:
- --cpu 0 - uses all available CPU cores.
- --timeout 5m - runs the test for 5 minutes.
- --metrics-brief - shows a short performance summary at the end.
Monitor the Temperature During the Test
Open a second terminal window and run:
This command updates the temperature every second.
To stop it, press: CTRL + C
Important
Keep an eye on the temperature, especially if you are using a Raspberry Pi 5.
If the temperature gets close to 80 °C, your Raspberry Pi may start to reduce performance to protect itself.
Run a Heavier Test
You can also test the CPU and memory at the same time:
This test uses:
- all CPU cores;
- two virtual memory workers;
- about 75% of available RAM;
- a 10-minute test duration.
Use this test only if your Raspberry Pi has proper cooling.
Check Throttling After the Test
After the stress test finishes, run again:
If the result is:
then your Raspberry Pi completed the test without throttling.
If you get another value like 0xe0000, it may indicate:
0xe0000 = 0x20000 + 0x40000 + 0x80000
- 0x20000 → ARM frequency capping has occurred
- 0x40000 → Throttling has occurred
- 0x80000 → Soft temperature limit has occurred
...
- overheating;
- undervoltage;
- weak power supply;
- poor ventilation;
- insufficient cooling.
Create an Automatic Stress Test Script
Instead of typing all commands manually, you can create a script.
Create a new file:
Paste this code:
Save the file: CTRL + O ; ENTER; CTRL + X
Make the script executable:
Run the script:
Save the Results to a Log File
You can also save the result to a text file:
Temperature:
- Below 70 ºC: normally comfortable.
- Between 70 ºC and 80 ºC: ventilation should be improved.
- Above 80 ºC: automatic performance reduction may occur.
Possible Problems:
- Insufficient power supply
- Poor-quality USB-C cable.
- Case without ventilation.
- Incorrectly applied or missing heatsink.
- Heavy processes running at the same time.
Recommendation for Raspberry Pi 5: use an active cooler or a case with a fan, especially for long tests or computer vision projects.