Persistence Latency Issue?

Tags: #<Tag:0x00007f433c2e3930>

Hey All,

I’m running openhab on a rapsberry pi, and using mysql as my persistence service. Recently I’ve been getting the following message in my openhab.log:

2020-08-29 10:02:30.872 [WARN ] [ence.internal.PersistenceManagerImpl] - Querying persistence service ‘mysql’ takes more than 5000ms.

No noticeable change in performance, load averages seem nominal on the pi (load average: 0.69, 0.56, 0.53). I am currently shoving everything into mysql:

Strategies { everyMinute : "0 * * * * ?" every5Minutes : "0 */5 * * * ?" everyHour : "0 0 * * * ?" everyDay : "0 0 0 * * ?" default = everyUpdate }

Items {
* : strategy = everyChange, everyUpdate, restoreOnStartup
}

Any thoughts?

Why?
Although everyUpdate should not present a big load in most systems.

That’s just a symptom. Anything could be hogging resource that the persistence service needs, causing it to complain.

Blockquote
Why?

Because it shouldn’t present a big load in most systems.

Blockquote
Although everyUpdate should not present a big load in most systems.

Right, exactly. And my load averages (<1 across the board) don’t support that resources are hogged.

Blockquote
That’s just a symptom. Anything could be hogging resource that the persistence service needs, causing it to complain.

Cool cool cool. Thanks for your help! Additionally, no extra things have been added to my OpenHAB environment between when I didn’t see this warning and when it began to show up. So, I’m assuming it’s just latency issues within the persistence code base of OpenHAB and not actually a system-level issue. It hasn’t caused any issues with how information actually is saved in mysql, or increased the time interval between inserts. It’s just annoying.

It’s not totally cost free. You’re also increasing write traffic, which may have an impact on your SD card life if you’re using one.

“resources” includes more than processing. You might look at I/O transfer rates, whether to local media or network, for further clues.
Or perhaps something somewhere is just blocking, waiting on some external event.
I don’t know what tools are available to you to poke deeper at this.

Why, have you changed it, updated perhaps? You didn’t mention that. What version are you running currently?

The message means that your persistence service thinks that your MySQL service is taking too long about something. Taken at face value, that points at your MySQL service.

In reality, the obstruction in the MySQL service is just as likely to be due from competing or being blocked from some resource it needs - processor, storage - by some other user.
I have no magic wand to tell you where the problem lies, but if I were you I would look around for other clues.