Why is Influx DB using 50% CPU...it is too much!

My “box” does some home automation, but it mainly creates the interface for my devices like greenhouse controllers with full remote control via OH and telemetry history insight for regulation and actuators behavior. So that is why DB needs to store quite a lot of items frequently.

I am gonna experiment on test rig if different DB causes the same CPU load, which DB should I try that works with OH, and is not more complex to setup than Influx … (maybe MySQL, MongoDB).

Not sure if MySQL Trial expires, and if MongoDB is compatible with OH(as it has no persistence installation in paper UI) but @rlkoshak mentioned I could also try MongoDB.

Then I will decide if data rate needs to be optimized to store data like >> the extreme value(in + or -) of that minute, stored every minute. But not sure how to do that for multiple items easily.

Thanks Matej

I’m surprised. The “response time” on greenhouse environments is so long it doesn’t seem to warrant that frequent logging.

It used to be there. Maybe something went wrong with it and no one bothered to fix it so it was dropped. But if you search the forum you will see several posts indicating people are/were using it.

Great News, it was no need for other DB, first, I thought that storing to the database was tasking, but I FINALLY FOUND OUT that I had about 20 querries like those two running from rules EVERY SECOND.
image

I have written these rules about a month ago, forgot about them and never revisited them until today. I started InfluxDB on Fast Ryzen PC and it was taking about 7% of CPU than I extended InfluxDB console to full screen and found out that only queries were going out for those OH averaging queries than it struck me … That is the problem, loads of data is pulled from DB and being analyzed every second and not allowing my server to run normally.

Storing data isn’t even noticeable on CPU load but pulling queries from a database and analyzing data is quite tasking. The load was getting higher over time as the database had more data and I have averaging set for up to one year in the past. With that being said I have InfluxDB now for about 2 months.

I happened to learn that the hard way.

Now CPU is on 40% most of the time and it spikes every 10s to 90% as expected due to persistence config and averaging rules running every 10s.

Even though that is a topic for influx developers…
It is worth mentioning that InfluxDB would be easier to debug if the in-time log (in runtime cmd window) would be more readable.
So that it would display in-time analytics instead of lots of long text running fast, that was only readable on really wide 27" monitor.

Thanks a lot for suggesting about querries that I should check…

Matej

1 Like