Thanks for your analysis.
Disk Write Limitation
I’m surprised, as this is not a problem that happens several times a day, which I temporarily solve by simply restarting.
Since this morning, the disk has been very lightly used with an average of 50 KB/sec, far from the 10 MB of this morning during the problem. There have even been aggregations since, without any particular issues.
Additionally, I turned off the CO2 sensor that seemed to be causing a lot of pollution.
In my opinion, the theory of the disk being saturated with writes is not the right explanation for all of this.
Well, I would benefit a lot from switching to a disk or SSD, but my case remains interesting for everyone who wants or cannot do so.
Locked Database
This is quite interesting. During heavy operations, such as the deletion of several thousand data entries in the database, I wonder at that moment if the disk is not saturated.
But in this case, is the database lock necessary? Is it inevitable, or can we make parallel queries to avoid blocking Gladys?
Because not being able to use Gladys in such cases is a bit unfortunate. Nothing works, the scenes, the configuration, the dashboards, etc.
I imagine that in a few years, I won’t be the only one to have so much data (approximately 2.5 GB to 3 GB).
By the way, is it possible to run a kind of performance maintenance on the database at night?
For example, check if there are any orphaned data and delete them (those with no associated sensor)?
Zigbee
I saw several events from Gladys warning that the MQTT connection was lost, then found, then lost again, etc.
Since the restart, it has returned to normal.
However, even now, Gladys is not receiving events from my devices and is no longer executing the associated scenes. Yet, the Zigbee2Mqtt interface still allows me to control my devices.