Skip to content

[feat]: create a warning if an instance has too many objects #3070

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

foxriver76
Copy link
Collaborator

@foxriver76 foxriver76 commented Jul 3, 2025

Link the feature issue which is closed by this PR

This is a proposal out of the blue after I yesterday noticed that I have 146k objects on my system, which lead to it being very slow. Often this happens due to BLE scanners, e.g. in my case one of my ESPresense devices was not configured to limit MQTT messages to specific MAC addresses and was sending every device it has seen once to the MQTT adapter.

Many users could wonder why their installation is that slow and would assume some adapter broke their installation or whatever and getting frustrated of ioB. Hence we should warn that there are issues in advance.

Implementation details

Introduced a state per adapter instance system.adapter.<adapter>.<instance>.objectsWarnLimit, this defaults to 5000.
If this limit is exceeded we generate a warning log + alert notification with some details. So user already knows which adapter instance is the problem.

If it is intended to have that many states, the user can manually increase the state.
The check happens one time at instance start.

Tests

  • I have added tests to test this feature
  • It is not possible to test this feature

Documentation

  • I have documented the new feature

If no tests added, please specify why it was not possible

We have no capabilities to test messages on controller level, as the main.js ist not actually running, only DB classes are running.

Copy link
Contributor

@GermanBluefox GermanBluefox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants