Stress Testing Your Raspberry Pi for Cooling and Overclocking

Part of the joy that is Raspberry Pi is getting stuck into it at a slightly lower level and finding out exactly what you can do with it if you take a look under the hood. One of the most popular experiments to do with your Raspberry Pi is overclocking it. Overclocking is fairly simple to do on the Raspberry Pi, however, it requires additional cooling in the form of heatsinks and fans to ensure that the Pi doesn't overheat and damage itself. You may also find that your Pi gets hot under heavy usage, and it can be a good idea to cool it down, especially when using intensive processes such as the N64 emulator for RetroPie. 

We've broken up the topics of cooling, stress testing, and overclocking your Raspberry Pi into individual tutorials to make it easier to digest. This is the second tutorial of the three: stress testing.

After much research on the internet regarding this topic, it was clear that there was no definitive guide with all of the information in one place, so we hope to answer all of your questions, however, if you want to know more, don't hesitate to get the conversation started in the comments below.


 

WHAT IS STRESS TESTING?

We had a look at different methods for cooling Raspberry Pi's in our previous tutorial Cooling Your Raspberry Pi, however, it's one thing having your Pi run at a nice 40C when idle, another when it's running at full throttle. Stress testing is an important part of overclocking as it tells you how hot your system runs while under heavy load, and also how stable it is. 

Stress testing is simply running a series of processes on your system which are designed to run the CPU at full power, and monitor the temperature and stability of the system. As we talked about in the previous tutorial, 80C is normally the high-temperature limit for most computer systems, so we need to run a stress test to make sure that our cooling is adequate to keep it under 80C. The hotter a processor gets, then less stable it becomes, so a cooler processor will lead to a more stable system.

Without any form of overclocking and stress testing, you need to ensure that your Pi is correctly powered. Whilst you might have a 5V power supply, it needs to be able to handle the extra current draw when the Pi is being maxed out. We recommend the official Raspberry Pi power supply which can push out 2.5A.

Today we'll be using two different stress tests, Stress which simulates real life, high-load usage across all of the Pi's resources, and cpuburn-a53 which maxes out your Pi's CPU completely (not to be used lightly!).

So without further ado let's run through the process of stress testing when you playing with cooling setups and clock speeds:

1. Implement cooling methods (heat sinks, fans etc.).

2. Run STRESS and ensure the system is stable and cool for 10mins of run time.

3. Run cpuburn-a53 and ensure the system is stable and cool for 10mins of run time.

4. Push the clock speed and overclock settings until the system is no longer stable (crash or freeze), then dial overclocking back to the last successful settings.

5. If the system is running too hot, consider adding extra cooling capabilities before trying again.

Whilst we haven't gotten into the specifics of overclocking yet (that's in our next tutorial in this series), it's important to test out the cooling on your Pi first and makes sure that it's doing something. That's the general process for stress testing your Pi, now let's take a look at the specific functions that are required.

HOW TO STRESS TEST YOUR RASPBERRY PI

Now it's time to find out what your Pi is really made of. Open up a terminal window and enter the following to download Stress and cpuburn-a53:

sudo apt-get install stress

wget https://raw.githubusercontent.com/ssvb/cpuburn-arm/master/cpuburn-a53.S

gcc -o cpuburn-a53 cpuburn-a53.S

Now to run these tests, we're going to be monitoring the ARM CPU frequency to see whether the Pi automatically throttles the speed (indicates temperature of +80C) and the core temperature. Pay close attention to these, and if the temperature gets too hot, be prepared to pull the power. It's a good idea to run these tests on a fresh image of Raspbian to ensure that any important files don't get corrupted in case you need to pull the power (in case of a system freeze, crash or over-temp).

**If you need to shutdown your system while it's non-responsive, try pressing alt + prtscr + b before pulling the power, if that doesn't work, then remove the power supply**

To run Stress, use the following terminal command:

while true; do vcgencmd measure_clock arm; vcgencmd measure_temp; sleep 10; done& stress -c 4 -t 900s

Monitor the CPU frequency and temperature for 10mins and only move on to cpuburn-a53 if the test is run for 10mins without throttling or +80C temperatures.

Stress test Raspberry Pi

while true; do vcgencmd measure_clock arm; vcgencmd measure_temp; sleep 10; done& ./cpuburn-a53

cpuburn-a53 Raspberry Pi test

You can see how tough the cpuburn-a53 test is. Using a basic cooling setup of a small heat sink and a small, low powered fan, within the 10-second delay between readouts, the temperature jumped 20 degrees! Bear in mind that we ran these tests overclocked to 1.4GHz rather than the standard 1.2GHz, but you get the idea. Ensure you Pi is cooled properly before running cpuburn-a53!

If you pass both of those. Congratulations! You have a stable and efficiently cooled Pi. If not, either dial down your overclock settings or implement additional cooling. It's important to note that cpuburn-a53 is the most intense CPU stress test you can run and doesn't represent a realistic real-life scenario. If you pass the Stress test well, but fail the cpuburn-a53, as long as your system was stable and didn't crash, you can still consider upping the clock speed for stability testing. It's up to you. Have a play around with different settings and find what works best.

And what's our guide for stress testing your Raspberry Pi, it's fairly straightforward, and if you use common sense, you won't damage your board. Refer back to this tutorial for testing cooling and overclock settings. Once you're comfortable with your setup, let's move on to the main event: Overclocking Your Raspberry Pi.

 

From the original blog post: https://core-electronics.com.au/tutorials/stress-testing-your-raspberry-pi.html
Previous Next

1 comment

Shannon (99Victor)

Yes! I am interested in testing, updating and configuring my /boot/config.txt file to get the best performance I can get. Between the 64bit full & 64 bit lite version, I always install and keep the format as close as I can.
Now; how can I run multiple test at the same time, get a hard/soft copy report, and verify what is the best config I can make?
Rt now, I use the following configuration in the config.txt file at the bottom of the file. Please keep in mind, I am new at this, been playing with the RPi for about a year or so! Please see below.
[pi4]

Run as fast as firmware / board allows
arm_boost=1
inital_turbo=1
arm_boost=1

boot_delay=1
disable_splash=1

arm_64bit=1 arm_freq=1200 arm_freq_max=1800

gpu_mem=256
temp_limit=80

over_voltage=8
over_voltage_max=10
sdram_freq=600

over_voltage_sdram=6
over_voltage_sdram=c
over_voltage_sdram=i
over_voltage
sdram=
p

Leave a comment

Please note, comments need to be approved before they are published.