Maintenance mode takes long to (de-)activate

Hello Folks,

when I run “occ maintenance:mode --on” it takes roughly 30 seconds until the maintenance mode is active, same for turning it off. I tried creating a file in this time and it was beeing created. Is this a normal (aka expected) behavior? When updating an app the maintenance mode start immediately.

I want to use the maintenance mode while triggering a backup, since I use ZFS a backup doesn’t take a lot of time, but I’d like to make sure that nextcloud is in a safe state. On the same time I want to reduce downtime, so I thought instead of stopping the container I could just put it into maintenance mode and then put it out of maintenance mode again. However, restarting the container seems faster at the moment.

Nextcloud version: 26.0.4
Operating system and version: official docker container (production) on unraid host

Any ideas if I’m doing something wrong or if there is some kind of config I might be doing wrong?

Thank you in advance

At first I thought you were referring to occ clock run time, but I realized you just mean how long it takes for the change to take effect. You’re likely waiting for the opcache.revalidate_freq in PHP. It defaults to 60s in the community Docker image:


You are the MVP here, not only giving the aber, but also providing reference which explains it even further! Thank you man, decision is clear now, just stop the container, create backup and then restart the container.

1 Like