Netatmo migration integration: Gladys crash

After starting the migration of a Netatmo device, after 49 minutes and only 5% completed, Gladys crashed and apparently restarted :frowning:


Logs available for analysis.

I have the 2 consumption calculations that were not progressing very fast and looking at the CPU curves (4 vCPU), it did not exceed 10%.
Are we on single-thread for calculations or am I completely wrong?


The crash is at 22:17 on the graph, the white corresponds to unretrieved information, Gladys was working very well.
On the disk side, I have ups and downs and since the crash I have remained very high!

How do you clean all this up? a docker reboot?

EDIT: adding average load:

After investigating, it’s my Proxmox script that sees the RAM is maxed out (5.9GB/6GB) during migration and then restarts the Gladys Docker container.
I’m going to disable that.
But how much RAM is needed to migrate a device without migrating its history?
I get the impression it uses a lot of memory.

It depends on the volume of scenes / dashboards to migrate, but it’s relatively lightweight, I think.

After that, migrating the history should easily run on your machine, I think

I don’t have a lot of scenes/dashboards where I use the anemometer for example (that’s what I was trying to migrate.
My duckDB is almost 10GB, does that matter?
Anyway, yesterday I migrated the device without any history and it caused the RAM to spike until it crashed (6GB) and then manual restart due to OOM.
Today I increased my LXC from 6 to 8GB of RAM, launched the migration without history: super fast!


But then it takes a crazy amount of RAM and especially the RAM is not released at all afterwards :face_with_raised_eyebrow:

I admit I don’t understand what’s happening, if anyone has a clue?

EDIT: my LXC docker config → 4vCPU, 8GB RAM, Disk 30GB.

Oh indeed, if your database is 10 GB and there are many states to migrate, then yes it can take a lot of time and a lot of RAM.

Do you have the possibility to temporarily allocate more RAM just for the duration of the migration?

Regarding the memory that “doesn’t free up” afterward: this is normal and it’s not a leak. DuckDB keeps its pages in cache up to its memory limit and the system doesn’t immediately release it. It is reused by Gladys and freed under pressure.

And I advise you to disable automatic restart on RAM threshold during this kind of operation: restarting Gladys in the middle of a migration leaves the work half done (it’s replayable, but it’s better to avoid it).

already done

already done but I’ll have to go to 10 or 12GB because I’ve been migrating for over an hour and the 8GB is full and Gladys is crashing, the dashboard is no longer refreshing :frowning:

ok I’ll monitor then to see what happens over time.

Well, I’m going to restart Gladys again :frowning:

Has anyone had the same issue with a migration?

I have the same issue when I delete a device.

@mutmut, No issues on my end with a configuration almost identical to yours.
I migrated my Netatmo thermostat without any problems, no slowdowns, and it was very quick. My database is 6 GB

I managed to upgrade my LXC to 12GB live without rebooting, and the migration of my external station (with everything to migrate) took 1 hour and 26 minutes, with significant slowdowns in consumption calculations during the migration.


I’m switching to the internal probe with everything to migrate.
In any case, for the 4 modules to migrate, one by one, I’m at over 24 hours :frowning: