I’m currently using Nextcloud AIO and was wondering if there’s any benefit to rebooting my server regularly, say once a week.
My question comes from my experience with hosting Minecraft servers, where periodic reboots can definitely help with performance and stability.
While I don’t think my Debian server needs regular reboots, I wouldn’t mind if my server was down for 5 minutes during the night if it could improve performance or stability.
To be honest, the regular boots in Minecraft, for example, are only necessary because the software is not programmed 100% correctly. If it were 100% correct, the reboots would also be completely unnecessary in Minecraft.
I see no reason to boot Debian or, for example, to stop and start the web server or database.
I think this approach comes mainly from the Windows world.
Reboots are important for safety reasons. For example, new kernels or various libraries are only loaded once the server or the respective service has been restarted. You are less exposed to this, as Nextcloud AIO is in Docker anyway, but it still remains a problem for the host system. My tip: Install the Debian package needrestart and create a cronjob.
apt install --yes needrestart
# restart outdated services
0 1 * * * root /usr/sbin/needrestart -l -r a
# restart server if service restart was not enough
0 2 * * * root /usr/sbin/needrestart -p || /sbin/reboot
This means that the server is only restarted if necessary.
I always forget that Systemd can now do everything… With the principle “new is always better”, the recommendation to use Systemd is probably correct. In practice, it probably makes little difference, as backward compatibility will be guaranteed for a long time.
I’d say it makes no difference at all, and definitely not on Debian, Ubuntu and Fedora, because at least on those, /sbin/shutdown is just a symlink to /bin/systemctl.
ls -al /sbin/reboot
lrwxrwxrwx. 1 root root 16 5. Aug 02:00 /sbin/reboot -> ../bin/systemctl