Loss of communication and commands at 00:00

Hello,

I have often noticed that at midnight commands and scene triggers stop working. The situation returns to normal several minutes later. It’s not very serious for now because I haven’t set up the alarm yet. I use Gladys Plus, and it’s certainly due to database synchronization.
Do you experience this issue?

Hi @Jluc :slight_smile:

Indeed there is an automatic backup that runs randomly between midnight and 2:00 AM (so that everyone doesn’t hit the Gladys Plus server at the same time), and this backup can cause a slight database lock while it is being copied.

You can normally see at what time your backup ran in the « Tâche en arrière plan » tab and even see the backup progress in real time :slight_smile:

Is the timing an issue for you?

The speed of the backup also depends on your hardware — the faster your disk, the faster it will be.

On my side, on a mini-PC with an NVMe SSD and a 650Mb database, the DB « lock » lasts less than a second and is therefore invisible:

2024-05-22T00:20:55+0200 \u003cinfo\u003e gateway.backup.js:55 () Backup attempt n°1 : Cleaning backup folder
2024-05-22T00:20:55+0200 \u003cinfo\u003e gateway.backup.js:59 () Starting Gateway backup in folder /var/lib/gladysassistant/backups/gladys-db-backup-2024-5-22-0-20-55.db
2024-05-22T00:20:56+0200 \u003cinfo\u003e gateway.backup.js:61 () Gateway backup: Unlocking Database
2024-05-22T00:20:56+0200 \u003cinfo\u003e gateway.backup.js:67 (Gateway.backup) Gateway backup : Success! File size is 617mb.
2024-05-22T00:20:56+0200 \u003cinfo\u003e gateway.backup.js:69 (Gateway.backup) Gateway backup: Gzipping backup
2024-05-22T00:21:15+0200 \u003cinfo\u003e gateway.backup.js:73 (Gateway.backup) Gateway backup: Encrypting backup
2024-05-22T00:21:15+0200 \u003cinfo\u003e gateway.backup.js:80 (Gateway.backup) Gateway backup: Uploading backup, size of encrypted backup = 149mb.
2024-05-22T00:21:22+0200 \u003cinfo\u003e gateway.backup.js:124 (Gateway.backup) Gladys backup uploaded with success to Gladys Gateway.

The backup takes 27 seconds in total with GZIP, encryption and upload :slight_smile:

Hi @pierre-gilles,
Thank you for your reply.
I’m waiting until I can buy a mini PC and in the meantime I’m still running on a Raspberry Pi 3B (PI3B) and a 240 GB SSD.
If there’s a way to shift the backup time

It’s true that it doesn’t seem crazy to me to move to the 2–4 AM slot, which is a period when most people are asleep rather than at midnight!

I made a PR:

1 Like

Great! Thanks again
image

1 Like

It’s clear that the mini PC really changes your life. Before, I had a Raspberry Pi 4 with an SSD, and almost every evening when I wanted to turn off a light I ran into a backup that lasted a few minutes.

Since I switched, it’s completely seamless.

2 Likes

No, that’s not it! This task is the Zigbee2mqtt backup.

It looks like this:

As of Gladys Assistant 4.42.1, backups now run from 2 AM to 4 AM:

I’m closing this thread!

1 Like