Investigation into high system resource usage

Good evening,

I could use a little help because Gladys has really been acting up since the OS on which Docker is installed was upgraded:

As a result, pretty much everything is saturated: disk I/O, CPU, RAM… The Gladys interface is, of course, responding very slowly and I can no longer access the integrations…

In short, help :sweat_smile:

Have a good evening,
Jean

Hi @jean_bruder :slight_smile:

Do you have more data to be sure it’s Gladys that’s acting up?

Do you have anything else on this machine? What hardware are you running on?

Good evening @pierre-gilles :slight_smile:

The hardware hasn’t changed (PINE A64-LTS - PINE64), and has been working perfectly since I started using Gladys. Docker runs a few other containers whose overall load is very modest.

The test performed was simple: start one container after another. And it’s Gladys that suddenly causes the machine to crash…

Sorry if I’m repeating myself, but the only change made is an OS upgrade (Armbian from Bullseye to Bookworm).

How can I provide more information in order to determine the cause of this strange behavior?

Thanks,
Jean

Ok, and how many devices do you have? Lots of cameras? Lots of scenes?

Gladys itself doesn’t use anything at idle, it all depends on what you run on it! If you have lots of cameras and you’re reading 5 video streams in parallel, then it’s normal for it to struggle :smiley: Especially on such lightweight hardware.

You can also check Gladys’ logs to maybe understand what’s going on (docker logs gladys)

how many devices

25 Zigbee devices (now that we can use them :heart_eyes:) and 5 Tasmota.

Many cameras

None in Gladys.

Many scenes

Only about twenty

look at Gladys logs

They contain quite a few anomalies related to missing devices :

2024-06-05T21:34:43+0200 index.js:16 (process.) NotFoundError: DeviceFeature tasmota:Tasmota05:POWER not found
at DeviceManager.newStateEvent (/src/server/lib/device/device.newStateEvent.js:17:11)
at EventEmitter.emit (node:events:517:28)
at Event.emit (/src/server/lib/event/index.js:18:16)
2024-06-05T21:34:43+0200 index.js:15 (process.) unhandledRejection catched: Promise {
NotFoundError: DeviceFeature tasmota:Tasmota03:POWER not found
at DeviceManager.newStateEvent (/src/server/lib/device/device.newStateEvent.js:17:11)
at EventEmitter.emit (node:events:517:28)
at Event.emit (/src/server/lib/event/index.js:18:16)
}
2024-06-05T21:34:43+0200 index.js:16 (process.) NotFoundError: DeviceFeature tasmota:Tasmota03:POWER not found
at DeviceManager.newStateEvent (/src/server/lib/device/device.newStateEvent.js:17:11)
at EventEmitter.emit (node:events:517:28)
at Event.emit (/src/server/lib/event/index.js:18:16)
2024-06-05T21:34:43+0200 index.js:15 (process.) unhandledRejection catched: Promise {
NotFoundError: DeviceFeature tasmota:Tasmota01:POWER not found
at DeviceManager.newStateEvent (/src/server/lib/device/device.newStateEvent.js:17:11)
at EventEmitter.emit (node:events:517:28)
at Event.emit (/src/server/lib/event/index.js:18:16)
}
2024-06-05T21:34:43+0200 index.js:16 (process.) NotFoundError: DeviceFeature tasmota:Tasmota01:POWER not found
at DeviceManager.newStateEvent (/src/server/lib/device/device.newStateEvent.js:17:11)
at EventEmitter.emit (node:events:517:28)
at Event.emit (/src/server/lib/event/index.js:18:16)
2024-06-05T21:34:44+0200 handleMqttMessage.js:113 (Zigbee2mqttManager.handleMqttMessage) Zigbee2mqtt device zb_pir_entree not configured in Gladys.
2024-06-05T21:34:44+0200 handleMqttMessage.js:113 (Zigbee2mqttManager.handleMqttMessage) Zigbee2mqtt device zb_pir_salle-a-manger not configured in Gladys.

Is that a lead?

Thanks,
Jean

I don’t think so.

On the « Systems » tab → « Tasks », do you see anything?

On the « Systems » tab → « Tasks »

Well, I just recreated the container « gladys-z2m-mqtt », setting the version to « latest » (2.0.18) and restarted the whole thing …

image

Result: Gladys is working normally again …

It started working on its own as we say around here … So I think the problem wasn’t related to Gladys, but rather to something on the MQTT/ZB side :face_with_raised_eyebrow:

However, I’m no longer receiving any data from the temperature/humidity sensors:

Any idea? :stuck_out_tongue:

Thanks,
Jean

Some data is starting to come through…

Let’s be patient :slight_smile:

In any case, thank you once again @pierre-gilles for your availability!

Have a good evening,
Jean

Should we be worried about the size of the database?

Jean

Hi @jean_bruder,

It all depends on how much space you want to give it ^^
For info, mine is 32GB and runs on a nice little mini PC recommended by @pierre-gilles, and so far no particular lag issues. The only problem is removing a feature or a device because deleting the state history becomes very problematic. But the upcoming arrival of DuckDB may solve this… we’ll see

Hello @Terdious :slight_smile:

I’m going to migrate Gladys this weekend to another platform (ROCK64 - PINE64) that I will dedicate to Gladys, and see how it all works. In the meantime, Gladys is on holiday, and that’s really when you see how handy this thing is in daily life! Anyway, wait’n see :wink:

Have a nice day,
Jean

Great, glad you resolved your issue!

@jean_bruder Have you already bought your hardware?

The best option is really mini-PCs to seriously get started with Gladys.

For me, the most important thing if you want an instance that runs long-term is a fast drive (SSD required), and a quality CPU.