Raspberry Pi 2 CPU load

Just a bit of a discussion point if I may.

I have been running OH and then OH2 ( and now OpenHabian) for a number of years on a Raspberry Pi2 with no major issues.
I run zwave with just 6 devices.
I run the exec binding to execute several bash or python scripts at varying intervals but none more frequent than 120 secs. These update an rrdtool database and produce some graphs using HighCharts.
I also run mqtt to control some blinds with very low traffic

Recently, not long after upgrading to OH 2.5.0, I added Influx/Grafana to replace the rrdtool DB and the old way of producing graphs.

Unfortunately I don’t have past records for comparison but what I see now is that OH2 is using 45.3% of MEM and CPU load varies from 1.3% to 5% with very occasional spikes in the 15-24% range.

So my question is: is this reasonable, sustainable or is it getting risky?

The Raspi 2 specs are 900MHz quad-core ARM Cortex-A7 processor with 1 GB SDRAM.
The Raspi 3 is also a 4-core processor and same 1 GB RAM but runs at 1.2GHz.
Only the Raspi 4 has options on RAM of 2GB and 4GB but is there a strong need for me to upgrade?

What do other users see in the performance of their equipment running OH?

I have run openHAB on RaspBerryPi 3b+ for 2 Years with no problem.
There is an official “recommendation” here https://www.openhab.org/docs/#while-you-are-getting-started which recommends rpi 4 but also states pi2-3 is also fine.
It really depends on the use-case.

The best advice I can give for PI users, don’t use an SD-Card, switch to USB or SSD via USB.
The only problems I had was from dying SD-Cards.

Thanks for your reply @BrutalBirdie. I have also set my system up on a USB SSD to get over SD card issues.
Any chance you could do a top | grep java on your system and post back the sort of numbers you get.

Yes

Yes

If you want, monitor your raspi temperature. (Google it) But it should be just fine hovering between 40 and 50

1 Like

On an RPi 2 that looks well within the reasonable range given your description of your setup.

If you are not having any other problems I see no reason why you would want to upgrade. It looks like your OH is running quite comfortably on that machine.

I run in Docker on a VM so it’s hard to compare to what you are seeing (it’s not apples to apples). But I’m seeing about 1.8 GB of resident RAM and <5% of the two virtual CPUs I’ve allocated to the VM. But the fact that I’m running in Docker greatly expands the memory usage, hence why it’s not an apple to apples comparison.

I have a very minimal OH installation on an RPi 3 that uses 324 MB of resident RAM and consumes almost no CPU. But it pretty much is just reporting events from one Zwave device to my main OH using MQTT.

As others confirm, the numbers are reasonable. CPU is nowhere near an issue.
Adding Grafana however really pushed memory usage of your box to its limit.
That probably resulted in increased paging already and in turn would have put your SD card at a larger risk if you hadn’t moved to SSD.

Thanks all for these helpful comments.
I guess the main reason I have posted is that I do have an issue and I think it relates to the newly added Grafana installation.
There are times when the Pi has “hit the ceiling” in some way, either CPU or memory usage have max-ed out and it becomes unresponsive. I then have to reboot.
So I have spent quite some time looking at top and free -m to see what is going on.
While Grafana only seems to use about 5% of MEM it can hit 60% occasionally but I recognise the potential for it to load things up if I were to ask for a 2 month chart etc…

Another thing that happens is that freshclam can claim 100% of CPU at times which I have seen after a restart but maybe can also happen of a daily re-fresh of its database. Others have had this : https://www.raspberrypi.org/forums/viewtopic.php?t=255898 but this is not my focus as it is only 1 of the 4 cores.
As the logs don’t reveal anything much I think I need to get some charts setup to monitor the Pi’s resources.
As people here have observed it seems to be running within reasonable limits. It’s a matter of tracking down what is going on with Grafana remaining on my watchlist.

Why didn’t you say that in the first place ? XY problem. Not fair to supporting people wasting their time with answers you don’t need.

You may want to enable ZRAM to “expand” some of your memory.
I’d remove the entries for /var/log and /var/lib/openhab2 from /etc/ztab, though. But keep swap on ZRAM.

Well, I don’t think any of the above is waste of time. Apologies to anyone who does so.

I did post that I was about having a discussion. Surely there is scope for this Community forum to host discussion topics as well as the highly valued troubleshooting assistance that is more generally offered.

My need was to evaluate the impact of two recent changes, upgrade to 2.5.0 (thanks to all developers and contributors) and the addition of Grafana.

The qualitative responses and comparisons with what other users experienced was valuable and hope is so also for others who might read this.

I will be installing and configuring Zram as suggested, thank you @mstormi and will also do some charting of CPU and MEM parameters to see where and when these freezes occur.