Optimizing Nextcloud on Proxmox VM for minimal ZFS disk activity

I have no support/technical question and have seen the support category. (Be aware that direct support questions will be deleted.)

on

Which general topic do you have

Hi everyone,

I’m setting up Nextcloud inside an Ubuntu VM on Proxmox and want to optimize for minimal activity on my spinning ZFS pool.

Current plan:

Install Nextcloud OS, database, and app data on NVMe.
Add the ZFS pool later, mounting it only for user storage.

My goals:

  • Avoid unnecessary pool spin-ups.
  • Keep all user files (old and new) fully accessible.

Is this considered best practice in a ZFS + Nextcloud setup? Are there alternative strategies for minimizing disk access while maintaining functionality?

Thanks for any guidance!

On these solid state drives, there is nothing spinning. And read access should be not very critical.

What creates access:

  • cronjobs: you can check the activity over the day and try to adjust the times (notifications, invitations, etc. might arrive later than expected). At night time this might be interesting.

  • Notifications: Clients usually poll for changes frequently (30s or so). You can use notify_push server: GitHub - nextcloud/notify_push: Update notifications for nextcloud clients
    this avoids the polling. But to really benefit, it is worth doing when you have a lot of clients. However, a lot of clients, there is a lot of activity, no interest in reducing the cronjobs, and also the need to “spin” up the disks.

Thank you! Maybe i wasn’t clear on my concept.

This is a home server and there won’t be more than 4-5 users. My proxmox is located on an NVME and next cloud runs inside an ubuntu VM on this drive. However i have a ZFS raid 1 array with 2x10TB seagate ironwolf drives which i want nextcloud to have access to.

So what i want is all services processes to run inside the VM and on the NVME and only access the raid if a user tries to read or write a file on it.

Some apps are storing files in the Data directory to and not only the users folders. All in all, then you will have some I/O on the data drive regardless. Add the cache (redis and aPCU for example), including if you implement AV scan, and you will have I/O more than you expect. You will still probably be very happy with this setup though. I do wonder, however, why you use a VM where you have to dedicate cores and memory, rather than LXC so you utilize whatever power is there, when it is needed, and let the Proxmox host natively distribute what is needed to each running process? You CAN add a maximum allowed resource consumption, selectively and individually for the containers you wish, but you will experience better performance and dynamic distribution of the system resources.

Are the minimal power savings (8w total) worth the additional wear on the drives?

And if yes, are you fine by waiting seconds for your pool to spin up?

Hi thank you for your feedback. As i was digging these days i found out that “there are a lot going on under the hood” on nextcloud so the disks are rarely going to sleep if they go at all.. What i was trying to accomplish is run “everything under the hood” on NVME and all the user files on the zfs pool. The hdds on the pool stays asleep and only spin up if a user tries to access files. There aren’t too many users right now accessing the file server (only 2) and i find it not necessary for the disks to run 24/7 without someone actually touching them.

so if it worths the power savings i don’t know.. probably not if it is about 8w difference on consumption. But if the drives are accessed 2-3 hours a day and the rest of the time asleep i believe they are better conserved. I might be wrong on that as the drives i have are supposed to run 24/7.

Take a look at the cronjobs. By default they run every 5 min. Also check, how much inactivity is required to put the disk asleep. Depending on that, you can try to run that job only every 15 min, and then perhaps even less during night. If you can easily check, if the cronjob wakes up the disk at all, since if the main thing is just to check the database, all the changes are perhaps not required.

There is an option to set cronjobs at different times for day and for night?

Your current cronjob probably looks like this:

*/5  *  *  *  * php -f /var/www/nextcloud/cron.php

*/5 means that it runs every 5 minutes.

*/5  6-23  *  *  * php -f /var/www/nextcloud/cron.php
*/20  0-6 *  *  * php -f /var/www/nextcloud/cron.php

You keep this cycle between 6 and 23 o´clock. And it runs only every 20 mins from 0 to 6.

There are a lot of howtos, cron checker like https://cron-checker.com/ to help you understand the syntax.

2 Likes

many thanks!!!

That’s a big topic, and I don’t know how many reliable statistics there really are about it.

What I do know is that there are enterprise server drives, mid-range NAS drives, and desktop or workstation drives. Enterprise drives are meant to run 24/7 continuously in servers. NAS drives are more of a middle ground, intended for consumer or SMB NAS systems, typically with fewer drives in the enclosure compared to enterprise setups. While all of these drives support power-save modes and spin-downs, NAS and desktop drives are “designed” to spin down, whereas enterprise drives are designed to run continuously.

However, I highly doubt that consumer or NAS drives will last longer than an enterprise drive when spin-down is used, as lower-end drives are generally less durable. The benefits of NAS/workstation drives lies elsewhere in this context, for example, faster spin-up times, which might even cause more wear, but is, of course, necessary so you’re not waiting 10 to 15 seconds every time the drive is accessed.

Other factors matter too, like how much read/write activity there is. If nothing is being read or written, the read/write heads go into a parked position even if the platters don’t spin down, meaning no wear on the platters or heads. I’d say an enterprise drive with little to no read/write cycles could theoretically spin forever, while frequent spin-downs cause stress — not just to the motor, but also to the heads and platters.

Overall, I’d say enterprise drives are likely the most durable option, followed by mid-range/NAS drives. I’d avoid desktop drives for this use case. Whether you spin them down or not is up to you, but all drive types will probably last longer on average without the additional stress of constant spin-ups and spin-downs. That said, if you intend to spin them down, I’d probably go with mid-range consumer NAS drives, as they generally spin up faster than enterprise drives and are often quieter.

So, pick your poison, I guess. :wink:

that is really very insightfull. you gave me a lot to consider and some things i didn’t know

i am running a zfs raid 1 with 2 x 10Tb ST10000VN0008 Seagate IronWolf’s on a Fractal Node 804. These are according to Seagate “Designed for always-on, always-accessible 24×7 performance. Access data on your NAS any time, remotely or on site”

The temperatures inside the case on full access load never exceeded 38 degrees celcious.

Keeping in mind your reply and running commnads on proxmox saying that the drives are active but idle should put some ease on my mind.

I have edited my post again make to make it more consisten, and more relevant to your use case. Hope it helps :slight_smile:

1 Like

The only thing that really saves power is a spindown.

Regarding longevity, you have to ask yourself what is better for the drive.

A: constantly spin the motor, never park a head, constant temperature
B: put a lot of stress on the motor spinning up, none constant temperature

I don’t know if the difference is huge and I don’t have any data on that.

Not anymore, because of helium :slight_smile:
No seriously, helium will escape and the drive will die.

In general I like the warranty approach when it comes to all electronics.
I assume that a device lasts as long as it has warranty. The company knows the math on that way better than I could ever estimate.
If something lasts longer than warranty, I count it as a bonus.

Regarding drives, there is a reason why a normale drive comes with 2y warranty and an enterprise drive with 5y.

IMHO don’t worry about your config, only worry if you buy something with 2 or 5y warranty.

2 Likes

Yeah, I just wanted to add this, as part of the following (see the last section): :slight_smile:

@coyoty I removed this part from my previous post, but at least in theory, there could be a scenario where the drives last longer overall if you use spin-down.

However, this would probably only apply if the drives are used very lightly. I don’t know, mabe starting up and shutting down, maybe just two or three times a day, rather than 20 times or more. That said, I have actually no idea how little they would need to be used for the wear from start/stop cycles to be less than the wear from 24/7 operation with minimal read/write activity. :wink:

Ans yeah, as @saettel.beifuss0 said, there are also helium drives, which brings yet another factor into the occasion :wink:

And don’t forget: the durability of mechanical drives is (and was) always a bit of a lottery. I’d always pay attention to the warranty period and consider anything beyond that a bonus. :wink:

2 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.