For AI agents: the complete documentation index is available at https://docs.ovhcloud.com/en/llms.txt, the full documentation bundle is available at https://docs.ovhcloud.com/en/llms-full.txt, and this page is available as Markdown at https://docs.ovhcloud.com/en/guides/storage-and-backup/file-storage/ha-nas/nas-zfs-settings.md.

HA-NAS - Configuring the ZFS settings of a partition

View as Markdown

Find out how to apply a usage template or custom ZFS settings (atime, recordsize, sync) to an HA-NAS partition

Objective

Each partition of an HA-NAS service is a ZFS dataset. You can adjust three of its ZFS properties to suit the workload it stores: access time update (atime), maximum block size (recordsize) and write synchronisation (sync).

To make this easier, OVHcloud provides usage templates that apply a predefined combination of these settings in one step.

This guide explains what each ZFS setting does, which values each template applies, and how to change the settings of a partition from the OVHcloud Control Panel or via the OVHcloud API.

Requirements


OVHcloud Control Panel Access

  • Direct link:
  • Navigation path: Bare Metal Cloud > HA-NAS > Select your NAS-HA

Instructions

Warning

The default ZFS settings suit most uses. Only change them if you know the workload stored on the partition and the impact of each setting described below.

Understanding the ZFS settings

Access time update (atime)

When atime is enabled, ZFS updates the last access time of a file every time it is read, so each read also generates a write.

When atime is disabled (off), these extra writes are avoided, which improves performance for read-intensive workloads. Disable it unless an application stored on the partition relies on file access times. All the usage templates set atime to off.

ZFS recordsize

The recordsize is the maximum size of the blocks in which ZFS stores the data of a file. Files smaller than the recordsize use a smaller block: a 16 KiB file uses a 16 KiB block (plus metadata), not a full 128 KiB block.

As a rule of thumb, align the recordsize with the size of the application's reads and writes:

  • Small, random reads and writes (databases, virtual machine disks): a small recordsize avoids reading and rewriting a large block to change a few kilobytes.
  • Large, sequential reads and writes (video files, images, backups, archives): a large recordsize reduces the number of blocks and the metadata to handle, which improves throughput.

The available values are listed below. The Control Panel displays them in decimal units (1 KB = 1,000 bytes).

Value (bytes)Binary sizeDisplayed in the Control Panel
40964 KiB4.1 KB
81928 KiB8.2 KB
1638416 KiB16.4 KB
3276832 KiB32.8 KB
6553664 KiB65.5 KB
131072 (default)128 KiB131.1 KB (Default)
10485761 MiB1 MB
Info

A new recordsize only applies to files created after the change. Existing files keep the block size they were written with until they are recreated.

Sync

The sync setting determines how ZFS handles synchronous write requests, that is, requests for which the application waits for confirmation that the data is stored on disk.

ValueBehaviourUse
standard (default)ZFS honours synchronous write requests: the write is confirmed once the data is secured on disk. Asynchronous writes are buffered in memory.Recommended for all uses. Combines data safety and performance.
alwaysEvery write is handled as synchronous, even when the application does not request it.Maximum data safety, at the cost of lower write performance.
disabledZFS ignores synchronous write requests and confirms them before the data is written to disk.Very high performance, but data confirmed as written can be lost in the event of an incident. Not suitable for databases or NFS clients that rely on synchronous writes.
Danger

With sync set to disabled, an application may consider data as saved when it is not yet on disk. Only use this value if you fully understand the risk of data loss.

Usage templates

A usage template applies a predefined combination of the three settings to the partition in one step. All templates set atime to off and sync to standard. They only differ in the recordsize:

TemplateIntended useatimesyncrecordsize
DefaultGeneral file sharingoffstandard131072 (128 KiB)
Virtual machinesVirtual machine imagesoffstandard65536 (64 KiB)
DatabasesDatabase storageoffstandard16384 (16 KiB)
File Systems (big files)Large file sharing (images, videos, streaming)offstandard1048576 (1 MiB)

If none of these combinations suits your workload, set each value yourself with the Custom option (Control Panel) or the custom parameters (API).

Changing the ZFS settings of a partition

The change is applied to the whole partition by an asynchronous task.

OVHcloud Control Panel
OVHcloud API

Once your HA-NAS service is selected, open the Partitions tab.

In the partitions table, click the ... button on the row of the partition concerned, then click Configure usage (ZFS). The Edit settings window opens.

To apply a usage template:

  1. In the Select template drop-down list, select one of the templates: Default, Virtual machines, Databases or File Systems (big files).
  2. Click Edit settings to confirm.

To set custom values:

  1. In the Select template drop-down list, select Custom. The Access time update (atime), ZFS recordsize and Sync fields are displayed, filled in with the current values of the partition.
  2. Adjust the values you need: the Disable checkbox for atime, a value from the ZFS recordsize drop-down list, and one of the Always, Disabled or Standard options for sync. The default values are marked (Default).
  3. Click Edit settings to confirm.

A notification informs you once the ZFS settings of the partition have been updated.

Checking the ZFS settings of a partition

To check the settings applied to a partition, use the following API route:

The response contains the current atime, recordsize and sync values and, in the templateName field, the name of the template applied to the partition, if any.

Go further

Getting started with a HA-NAS solution

HA-NAS - Managing partitions via API

Mounting HA-NAS via NFS share

For training or technical assistance implementing our solutions, contact your sales representative or visit our Professional Services page to request a quote and have your project analysed by our experts.

Join our community of users.

Was this page helpful?