By default, openHAB only starts 5 threads to deal with execution of Rules. That’s not a lot, and if all threads are busy, rules have to wait until a slot is free. This results in slow Rule response time.
This can be improved.
The thread pool used by openHAB is defined in /etc/openhab2/services/runtime.cfg. Adding a line with org.eclipse.smarthome.threadpool:ruleEngine= will define the new number of threads used for the Rules engine. Rolling this out using Ansible, I use a lineinfile Task to update the configuration file:
| |
Most likely this config entry will not be there in the beginning, then the default of 5 is used. Adding this setting, and restarting openHAB results in 20 threads. Verification by using /usr/share/openhab2/runtime/bin/client:
| |
| |
The system is more responsive now, but with added workload the 20 might not even be enough in the future.
Comments
With an account on the Fediverse or Mastodon, you can respond to this post. Known replies are displayed below:
Note: This will load data from mastodon.social.
Learn how this is implemented here.
Share: