Recommendations for Nextcloud Storage Configuration with ZFS

I’m currently managing a Nextcloud (version 28) instance within a Docker container on an Ubuntu Server, with storage managed by ZFS. My server comprises two distinct ZFS storage pools: a small, but fast SSD pool named fastpool-1 and a capacious, but slower HDD pool named slowpool-1.

To segregate data effectively, I’ve bind-mounted ZFS datasets from these pools to specific directories within the Nextcloud container. The configuration data resides on fastpool-1, mounted to /var/www/html, while the bulk storage is situated on slowpool-1, mounted to /var/www/html/data. Additionally, I’ve integrated various local datasets—housing media such as music, movies, and photos—into the Docker container, employing them as local External Storage within Nextcloud.

/fastpool-1/docker/nextcloud -> /var/www/html
/slowpool-1/storage/cloud -> /var/www/html/data
/slowpool-1/storage/[media/photos/etc.] -> / [media/photos/etc.] (external storage)

Despite this setup, I’m curious about its optimization potential. Would it be beneficial to establish separate datasets within fastpool-1 for directories like /var/www/html/data/appdata_xxx or /var/www/html/data/appdata_xxx/preview?

Moreover, I primarily maintain read-only external storage, except for the Photos dataset, which will be actively used within Nextcloud. Could employing it as External Storage—despite being local—pose any drawbacks?

I’d greatly appreciate insights or recommendations from anyone experienced with leveraging ZFS for Nextcloud storage. Thank you in advance! :slight_smil

Without testing your specific use case nobody can tell what is the optimal setup. But in general I would expect the system to become faster if you store everything on fast storage… if you can afford it I would store apps, config and database on the fast storage and only static large files (…/data) and backups on slower cheaper storage.

Thanks for the input. There is nothing very special about my use case. It is just a Nextcloud instance for storing documents and photos and sharing with a couple of family members. I am just looking for best practises to optimize performance in general.

As I have mapped only the /var/www/html/data sub-directory to the slowpool dataset the remainder of /var/www/html (including apps, config, etc.) is mapped to the fastpool. The database is on a separate container also mapped to the fastpool.

I was wondering though, if it might be beneficial to also move some of the sub-directories under .../data to the fastpool. As you say, static large files could be on the slow drives, but the .../data directory contains more than just the mains storage…e.g. the preview directory.

I don’t think there is a “best practice” to separate the data on different disks. In general the storage should match your needs. whether fast, big or a mix of them. If you need speed and can afford fast storage for all you data - go for it. If the fast disk is not big enough and you must store part of the data on slower disk - put as many as you can on the fast disk… but in general try to KISS (keep it simple stupid) - don’t over-engineer it. complexity is always bad and you find a good sweet spot between speed and size - live with it until it doesn’t fit your requirements anymore and need to adjust it…