LXC Storage Dataset - Recommened Recordsize?

I have an ashift=12-based dataset set up on an NVME-based mirror to use to store LXC containers and templates.

My understanding is that LXCs do not use zVols, so the relevant property for controlling how data is written to disk is recordsize. Is that correct?

If so, PVE defaults to the default recordsize for new datasets: 128K.

I don’t really trust PVE’s defaults for ZFS to be actually optimized, since the PVE devs assume you know what you’re doing when it comes to setting up your own storage. :stuck_out_tongue:

So, question: I typically set recordsize to 1Mon datasets that don’t have workloads with specific instructions for how set it, since that’s ceiling. This isn’t a QEMU/KVM VM, so I’m not sure that the safe default 64k applies. For an LXC running a general purpose Linux server workload that doesn’t have some specific tuning recommendation, what’s a sane default? 1M, or something else?

You’re still trying to match the recordsize to the workload regardless.

If the container is doing a pretty mixed bag of “general stuff” I’d still recommend 64k.

If the container is really only providing access to / accessing media as whole files, not doing any significant database stuff or other small block random access, then 1M.

If the container is primarily running a database workload and needs to be optimized specifically for that, recordsize=16K.

Thanks!

That’s exactly what I needed.

It’s dangerous to summarize things, but it sounds using a dataset as backing storage for an LXC container is effectively the same as using the dataset for backing storage generally.

That is, the fact that the dataset is being used with an LXC container doesn’t really seem to change the general rules for setting the recordsize. Is that accurate?

Yep. That is accurate.