create account

How to stress test your Raspberry Pi by themarkymark

View this thread on: hive.blogpeakd.comecency.com
· @themarkymark ·
$28.17
How to stress test your Raspberry Pi
![image.png](https://files.peakd.com/file/peakd-hive/themarkymark/EPAk8We2-image.png)

If you read some of my recent posts I have been showing some really pretty charts like this as a result of my testing with the Pi 4.

![image.png](https://files.peakd.com/file/peakd-hive/themarkymark/WvU9hpKU-image.png)

I didn't create these charts myself, I used a utility called [Stressberry](https://github.com/nschloe/stressberry) which is really easy to use and allows you to graph the results of your test.  You can even combine the results of your test as I did above.

I'll walk you through the basics of using Stressberry and testing your own Raspberry Pi under different conditions.

# How to install Stressberry

Installation is simple but you do need to have Python installed.  I recommend Python 3 because I'm so done seeing Python 2 around.

First, install the Linux package **Stress*.

`sudo apt install stress`

Then install the Python package **Stressberry**

`pip install stressberry`

That's it!

---

# Using Stressberry

Using Stressberry is a two step process.  You first run a stress test that outputs a data file.  You then use the plotting tool to create a chart with your results.  You can use the results from multiple tests to combine them in a chart like the one you see at the beginning of this post.

In the simplest form, you can run these two commands to stress and plot.

```
stressberry-run out.dat
MPLBACKEND=Agg stressberry-plot out.dat -o out.png
```

If you want to plot multiple tests at once, just add them as a plot argument.

```
MPLBACKEND=Agg stressberry-plot test1.dat test2.out test3.out -o alltests.png
```

Super easy, but there are a few arguments you might be interested in.  

---

#### Stress Arguments

### Name - `-n`

I recommend this argument so you can have a label on your chart and keep track of which test is which.

### Duration - `-d` 

This option will set how long the test will be run in seconds.  I recommend 1800 so you can do a standard 30-minute test.

### Idle - `-i` 

This argument sets how long the run idles before and after the test.  I recommend 300 (5-minutes).

### Cores - `-c`

This specifies how many cores to use, on the Raspberry Pi you want to set this to 4.

### Putting it together

Stressberry will not be in your path so you will need to run `/home/pi/.local/bin/stressberry-run`

`/home/pi/.local/bin/stressberry-run -n "case" -d 1800 -i 300 -c 4 case.out`

---

#### Plot Arguments

### Display Frequency - `-f`

This will output the frequency of your CPU, this is needed if you want to monitor throttling.

### Frequency Limits - `-l`

Specify the lower and upper limits to plot frequency.  I recommend `400 1600` unless you are overclocking, then I would go up to 2200.

### Temperature Limits - `-t`

Specify the lower and upper limits of temperature.  I recommend `30 90` for these limits.  I don't see a scenario you would want anything else.

### Output file - `-o`

Name of the png file you want to output your chart to.

### Disable transparency - `--not-transparent`

This is optional but I would recommend try with and without to see which you prefer.

### Putting it all together

`MPLBACKEND=Agg /home/pi/.local/bin/stressberry-plot case.out -f -l 400 1600 -t 30 90 -o case.png --not-transparent`

---

# Conclusion

Stressberry is an awesome test kit to try different scenarios with your Raspberry Pi.  It is really easy to use and effective.

A typical test I do the following two commands changing the name in the first command to describe my current test.

```
/home/pi/.local/bin/stressberry-run -n "case" -d 1800 -i 300 -c 4 case.out
MPLBACKEND=Agg /home/pi/.local/bin/stressberry-plot case.out -f -l 400 1600 -t 30 90 -o case.png --not-transparent
```

I also have a script I use to upload an image to imgur but you can use sftp.

```
imgur case.png
```

---

<center>Securely chat with me on [Keybase](https://keybase.io/officialmarky)
<center>https://images.hive.blog/0x0/https://steemitimages.com/DQmcWxV1dpA1eAtw2ipwZiWZkydyVNU5LaLa2Ak1GUnbGmS/The-Marky-Mark.png </center>
# <center>  [Why you should vote me as witness](https://peakd.com/witness-category/@themarkymark/why-you-should-vote-for-themarkymark-as-witness)  </center> # 
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 365 others
👎  , , , , , , , , , , , , , , , ,
properties (23)
authorthemarkymark
permlinkhow-to-stress-test-your-raspberry-pi
categoryhive-163521
json_metadata{"app":"peakd/2020.06.2","format":"markdown","tags":["hive-163521","raspberrypi","technology","palnet","neoxian","tutorial"],"users":["themarkymark"],"links":["https://github.com/nschloe/stressberry","https://keybase.io/officialmarky","/witness-category/@themarkymark/why-you-should-vote-for-themarkymark-as-witness"],"image":["https://files.peakd.com/file/peakd-hive/themarkymark/EPAk8We2-image.png","https://files.peakd.com/file/peakd-hive/themarkymark/WvU9hpKU-image.png","https://steemitimages.com/DQmcWxV1dpA1eAtw2ipwZiWZkydyVNU5LaLa2Ak1GUnbGmS/The-Marky-Mark.png"]}
created2020-07-01 04:03:54
last_update2020-07-01 04:03:54
depth0
children1
last_payout2020-07-08 04:03:54
cashout_time1969-12-31 23:59:59
total_payout_value16.692 HBD
curator_payout_value11.477 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length4,234
author_reputation1,779,983,446,894,978
root_title"How to stress test your Raspberry Pi"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id98,273,241
net_rshares82,807,913,455,711
author_curate_reward""
vote details (446)
@hivebuzz ·
Congratulations @themarkymark! You received a personal badge!

<table><tr><td>https://images.hive.blog/70x70/http://hivebuzz.me/badges/birthday-3.png</td><td>Happy Hive Birthday! You are on the Hive blockchain for 3 years!</td></tr></table>

<sub>_You can view [your badges on your board](https://hivebuzz.me/@themarkymark) And compare to others on the [Ranking](https://hivebuzz.me/ranking)_</sub>


###### Support the HiveBuzz project. [Vote](https://hivesigner.com/sign/update_proposal_votes?proposal_ids=%5B%22109%22%5D&approve=true) for [our proposal](https://peakd.com/me/proposals/109)!
properties (22)
authorhivebuzz
permlinkhivebuzz-notify-themarkymark-20200701t135439000z
categoryhive-163521
json_metadata{"image":["http://hivebuzz.me/notify.t6.png"]}
created2020-07-01 13:54:39
last_update2020-07-01 13:54:39
depth1
children0
last_payout2020-07-08 13:54:39
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length593
author_reputation369,406,531,494,870
root_title"How to stress test your Raspberry Pi"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id98,280,845
net_rshares0