openhab / openhab1-addons

Add-ons for openHAB 1.x
Eclipse Public License 2.0
3.43k stars 1.71k forks source link

[mysql] openHAB 2.5.3: (Keeps) open too much DB connections #5947

Closed gsantner closed 4 years ago

gsantner commented 4 years ago

Hi, I've recently upgraded OpenHab via deb/u repo and since that other appplications have issues connecting to MySQL database. (Error too much connections). With statement show processlist I found out that OpenHAB creates a significat amount of connections, and is the only one todo so. Thus other applications seem not to be able to run additional queries. Note: MySQL persistence is enabled for about 10 items.

Is it really required that OpenHAB opens so much connections to DB, and keeps them open? It seems more like a bug to me. Note that, after restarting openhab (systemctl restart openhab2) other apps work for some time and stop working afterwards due this issue.

See screen: screenrecord (Kopie 1)

gsantner commented 4 years ago

@wborn just see it's moved to openhab1-addons, is that the correct place to place reports?

by the way, I had tried multiple times to re-use openhab..but always when I start using it some minutes afterwards all other services stop working because openhab floods everything. Thus openhab is broken for me at least

9037568 commented 4 years ago

just see it's moved to openhab1-addons, is that the correct place to place reports?

If it weren't he wouldn't have put it here.

That being said, this is unlikely to be looked at. This repository is mostly closed to new work. Perhaps the problem won't exist in the new OH3 persistence.

wborn commented 4 years ago

is that the correct place to place reports?

The openHAB code is distributed across multiple repos. In OH 2.5 the persistence add-ons from this repo are used. In OH3 it will use them from the openhab-addons repo.

The openhab-distro repo doesn't host a lot of code. It's mainly about aggregating all code and putting it in a .zip/.tar.gz .

Since we have so many repos it's common users create issues in the wrong repo. But luckily we can transfer issues these days so it's not a big problem. :-)

Thus openhab is broken for me at least

When I first started using OH it also had blocking issues for me and it was missing crucial features. Only after fixing/adding them myself with PRs openHAB turned into a viable option instead of using my own custom build automation solution.

wborn commented 4 years ago

I gave it a test and for me the MySQL Persistence worked just fine with MariaDB (latest) in a Docker container with persistence enabled in OH 2.5.3 for 20 items. There was only one connection showing for openhab in the processlist.

gsantner commented 4 years ago

I've tried reinstallation of openhab and still same issue.

I've stopped using openhab as otherwise I cannot use any other (DB) application on that host.