Operating system and version (eg, Ubuntu 20.04):
Armbian 23.02.2 Jammy (Ubuntu)
Apache or nginx version:
The issue you are facing: HDD is always spinning
Steps to replicate it:
- Install Docker-AIO
- Run with DATADIR pointing to a HDD
- HDD is always spinning
Is it possible to stop Nextcloud from constantly accessing files on the hard drive? Nextcloud itself is installed on the microSD card inside my Rock64 (similar to a Raspberry Pi). Only the data directory is external on the hard drive. For example, over night I’m not really accessing my data that much. It seems wrong to leave it running all the time, for multiple reasons:
- Energy consumption
- Wear and tear (starting and stopping 1-3 times a day seems like less wear than running it min. 8h unused every day)
I know it takes a few seconds for a HDD to spin up again, but those would be worth it (in my private environment).
Given that Nextcloud performs cron operations in the background, I think it’s unlikely disk access will stop for any prolonged period. If you have an appropriate NAS or server grade HDD attached, they are designed to run 24/7.
Now that you mention cron operations, do you mean the cron every 5 mins that I can set up in the admin panel? What are the disadvantages of using the other scheduling methods?
I think Nextcloud is designed to run 24x7 and standby disk means disk access delay when a file request or other requests coming to Nextcloud.
The real cron jobs run in the background. The other methods will be run when you access the interface and slow everything down. I wouldn’t do that if you use cronjobs.
Running the cronjob every 5 min, is a compromise to fit all needs (if the previous process is still running, it won’t start another one). Before it was at 15 min.
If you have a small setup and you don’t have a lot of activity at night time, I don’t see a problem to not run the cronjob during the night and to thin out the cronjob runs every 30-60 minutes during the day.
The cronjob creates things in the back ground, sends notifications, cleans up expired shares etc.