HA-NAS - Configuring the ZFS settings of a partition
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
- An OVHcloud HA-NAS service with at least one partition
- Access to the OVHcloud Control Panel, or to the OVHcloud API (see the OVHcloud API first steps guide)
OVHcloud Control Panel Access
- Direct link:
- Navigation path:
Bare Metal Cloud>HA-NAS> Select your NAS-HA
Instructions
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).
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.
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:
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.
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:
- In the
Select templatedrop-down list, select one of the templates:Default,Virtual machines,DatabasesorFile Systems (big files). - Click
Edit settingsto confirm.
To set custom values:
- In the
Select templatedrop-down list, selectCustom. The Access time update (atime), ZFS recordsize and Sync fields are displayed, filled in with the current values of the partition. - Adjust the values you need: the
Disablecheckbox for atime, a value from theZFS recordsizedrop-down list, and one of theAlways,DisabledorStandardoptions for sync. The default values are marked (Default). - Click
Edit settingsto 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
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.