Just for fun, I wrote a test script to create lots of items.
- I have 128GB of RAM, but some of it is used by other stuff. It’s safe to say I should have around 64GB free at least
- I tried creating 10,000 items (in addition to my existing items of around 1000).
- I noticed that it started getting a bit slower after 5000 - 6000 but it was still fine all the way up to 10,000 items. The system isn’t swapping.
- I then tried creating 100,000 items, at > 10,000 it’s getting even slower to just create each additional item. Still not swapping. It’s still chugging along trying to create items, it’s at 38,000 now but progress is slow. I can restart openhab gracefully though.
I noticed this warning in the log:
02:03:16.067 [WARN ] [hab.core.internal.events.EventHandler] - The queue for a subscriber of type 'class org.openhab.core.automation.internal.module.handler.GroupStateTriggerHandler' exceeds 5000 elements. System may be unstable.
I know this doesn’t really help you figure out the limits for a 4GB Rpi though, but maybe try writing a similar script.
Here’s my script in JRuby:
MAX = 10_000
items.build do
1.upto(MAX) do |i|
switch_item "TestAA#{i}", "TestAA#{i}"
logger.info "#{i} items created" if (i % 100).zero?
end
end