High cpu on OH-OSGi-EventManager

Hi everyone,

I’m having a problem again and am hoping the community can help :slight_smile:

For quite some time now (probably since openHAB 3.x), I’ve been having an issue where my openHAB server has very high CPU usage, and I’d like to debug this once and for all :slight_smile:

I know that a lot has changed in recent years regarding thread debugging, but unfortunately, I’m having trouble interpreting the results…

Here’s what I can provide:

runtimeInfo:
  version: 5.1.3
  buildString: Release Build
locale: de-DE
systemInfo:
  configFolder: /etc/openhab
  userdataFolder: /var/lib/openhab
  logFolder: /var/log/openhab
  javaVersion: 21.0.10
  javaVendor: Eclipse Adoptium
  javaVendorVersion: Temurin-21.0.10+7
  osName: Linux
  osVersion: 5.15.0-176-generic
  osArchitecture: amd64
  availableProcessors: 3
  freeMemory: 598969160
  totalMemory: 1610612736
  uptime: 145295
  startLevel: 100
addons:
  - automation-jsscripting
  - binding-astro
  - binding-easee
  - binding-exec
  - binding-govee
  - binding-gpstracker
  - binding-homeassistant
  - binding-homematic
  - binding-http
  - binding-icalendar
  - binding-ipcamera
  - binding-km200
  - binding-matter
  - binding-miio
  - binding-mqtt
  - binding-networkupstools
  - binding-renault
  - binding-samsungtv
  - binding-shelly
  - binding-speedtest
  - binding-systeminfo
  - binding-telegram
  - binding-upnpcontrol
  - binding-wifiled
  - misc-openhabcloud
  - persistence-jdbc-mysql
  - persistence-mapdb
  - transformation-exec
  - transformation-jinja
  - transformation-jsonpath
  - transformation-map
  - transformation-regex
  - transformation-xpath
  - ui-basic
clientInfo:
  device:
    ios: false
    android: false
    androidChrome: false
    desktop: true
    iphone: false
    ipod: false
    ipad: false
    edge: false
    ie: false
    firefox: false
    macos: false
    windows: true
    cordova: false
    electron: false
    capacitor: false
    nwjs: false
    webView: false
    webview: false
    standalone: false
    os: windows
    pixelRatio: 0.8999999761581421
    prefersColorScheme: light
  isSecureContext: true
  locationbarVisible: true
  menubarVisible: true
  navigator:
    cookieEnabled: true
    deviceMemory: 16
    hardwareConcurrency: 8
    language: de
    languages:
      - de
      - de-DE
      - en
      - en-GB
      - en-US
    onLine: true
    platform: Win32
  screen:
    width: 1920
    height: 1080
    colorDepth: 32
  support:
    touch: false
    pointerEvents: true
    passiveListener: true
    intersectionObserver: true
  themeOptions:
    dark: light
    autoDarkMode: true
    bars: light
    homeNavBar: default
    homeBackground: default
    disableExpandableCardAnimation: false
    blocklyRenderer: null
    disablePageTransitionAnimation: false
    hideChatInput: false
    webAudio: false
    visibleBreakpointDisabled: false
  userAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML,
    like Gecko) Chrome/147.0.0.0 Safari/537.36 Edg/147.0.0.0
timestamp: 2026-05-04T06:37:44.223Z

The example is quite extreme, as I was also having overheating issues with the server and the CPU was heavily throttled, but even so, I consistently see a CPU utilization of 3 or higher…

Additionally, I ran a thread dump during the high-load phase, but I don’t really know what to make of it…

Server:

  • OS: Ubuntu Server 22.04.5
  • Platform: Proxmox 8.2.2
  • Cores: 3
  • RAM: 5 GiB
  • Things: 155
  • Items: 4921

When it’s spiked like this, do you see anything notable in the logs? For example, is events.log going crazy with lots of stuff happening or openhab.log showing a bunch of activity?

You can change the logging level of openhab.event.ItemStateUpdatedEvent to INFO and that will add the Item updates to events.log. I might be something is updating Items like crazy.

In MainUI under Settings → Rules do you see any rule or rules just constantly running?

With the info presented all I can really say for sure is that openHAB is indeed the one using up the CPU. The top suspect in that thread list is the rule Energiez-hler-Tagesverbrau… There is no reason any rule should be that high up in the list (assuming it’s sorted by CPU usage).