Skip to content

Commit 24ad63d

Browse files
Merge pull request #274859 from khdownie/kendownie050924
NFS performance acrolinx
2 parents cba44e5 + 17f9d7a commit 24ad63d

File tree

1 file changed

+27
-20
lines changed

1 file changed

+27
-20
lines changed

articles/storage/files/nfs-performance.md

Lines changed: 27 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
---
22
title: Improve NFS Azure file share performance
3-
description: Learn ways to improve the performance of NFS Azure file shares at scale, including the nconnect mount option for Linux clients.
3+
description: Learn ways to improve the performance and throughput of NFS Azure file shares at scale, including the nconnect mount option for Linux clients.
44
author: khdownie
55
ms.service: azure-file-storage
66
ms.custom: linux-related-content
77
ms.topic: conceptual
8-
ms.date: 09/26/2023
8+
ms.date: 05/09/2024
99
ms.author: kendownie
1010
---
1111

12-
# Improve NFS Azure file share performance
13-
This article explains how you can improve performance for NFS Azure file shares.
12+
# Improve performance for NFS Azure file shares
13+
14+
This article explains how you can improve performance for network file system (NFS) Azure file shares.
1415

1516
## Applies to
17+
1618
| File share type | SMB | NFS |
1719
|-|:-:|:-:|
1820
| Standard file shares (GPv2), LRS/ZRS | ![No, this article doesn't apply to standard SMB Azure file shares LRS/ZRS.](../media/icons/no-icon.png) | ![NFS shares are only available in premium Azure file shares.](../media/icons/no-icon.png) |
@@ -21,9 +23,9 @@ This article explains how you can improve performance for NFS Azure file shares.
2123

2224
## Increase read-ahead size to improve read throughput
2325

24-
The `read_ahead_kb` kernel parameter in Linux represents the amount of data that should be "read ahead" or prefetched during a sequential read operation. Linux kernel versions prior to 5.4 set the read-ahead value to the equivalent of 15 times the mounted file system's `rsize` (the client-side mount option for read buffer size). This sets the read-ahead value high enough to improve client sequential read throughput in most cases.
26+
The `read_ahead_kb` kernel parameter in Linux represents the amount of data that should be "read ahead" or prefetched during a sequential read operation. Linux kernel versions before 5.4 set the read-ahead value to the equivalent of 15 times the mounted file system's `rsize`, which represents the client-side mount option for read buffer size. This sets the read-ahead value high enough to improve client sequential read throughput in most cases.
2527

26-
However, beginning with Linux kernel version 5.4, the Linux NFS client uses a default `read_ahead_kb` value of 128 KiB. This small value might reduce the amount of read throughput for large files. Customers upgrading from Linux releases with the larger read-ahead value to those with the 128 KiB default might experience a decrease in sequential read performance.
28+
However, beginning with Linux kernel version 5.4, the Linux NFS client uses a default `read_ahead_kb` value of 128 KiB. This small value might reduce the amount of read throughput for large files. Customers upgrading from Linux releases with the larger read-ahead value to releases with the 128 KiB default might experience a decrease in sequential read performance.
2729

2830
For Linux kernels 5.4 or later, we recommend persistently setting the `read_ahead_kb` to 15 MiB for improved performance.
2931

@@ -46,11 +48,11 @@ To change this value, set the read-ahead size by adding a rule in udev, a Linux
4648

4749
## `Nconnect`
4850

49-
`Nconnect` is a client-side Linux mount option that increases performance at scale by allowing you to use more TCP connections between the client and the Azure Premium Files service for NFSv4.1, while maintaining the resiliency of platform as a service (PaaS).
51+
`Nconnect` is a client-side Linux mount option that increases performance at scale by allowing you to use more Transmission Control Protocol (TCP) connections between the client and the Azure Premium Files service for NFSv4.1.
5052

5153
### Benefits of `nconnect`
5254

53-
With `nconnect`, you can increase performance at scale using fewer client machines to reduce total cost of ownership (TCO). `Nconnect` increases performance by using multiple TCP channels on one or more NICs, using single or multiple clients. Without `nconnect`, you'd need roughly 20 client machines in order to achieve the bandwidth scale limits (10 GiB/s) offered by the largest premium Azure file share provisioning size. With `nconnect`, you can achieve those limits using only 6-7 clients. That’s almost a 70% reduction in computing cost, while providing significant improvements to IOPS and throughput at scale (see table).
55+
With `nconnect`, you can increase performance at scale using fewer client machines to reduce total cost of ownership (TCO). `Nconnect` increases performance by using multiple TCP channels on one or more NICs, using single or multiple clients. Without `nconnect`, you'd need roughly 20 client machines in order to achieve the bandwidth scale limits (10 GiB/s) offered by the largest premium Azure file share provisioning size. With `nconnect`, you can achieve those limits using only 6-7 clients, reducing compute costs by nearly 70% while providing significant improvements in I/O operations per second (IOPS) and throughput at scale. See the following table.
5456

5557
| **Metric (operation)** | **I/O size** | **Performance improvement** |
5658
|------------------------|---------------|-----------------------------|
@@ -77,25 +79,29 @@ We achieved the following performance results when using the `nconnect` mount op
7779
Follow these recommendations to get the best results from `nconnect`.
7880

7981
#### Set `nconnect=4`
82+
8083
While Azure Files supports setting `nconnect` up to the maximum setting of 16, we recommend configuring the mount options with the optimal setting of `nconnect=4`. Currently, there are no gains beyond four channels for the Azure Files implementation of `nconnect`. In fact, exceeding four channels to a single Azure file share from a single client might adversely affect performance due to TCP network saturation.
8184

8285
#### Size virtual machines carefully
83-
Depending on your workload requirements, it’s important to correctly size the client machines to avoid being restricted by their [expected network bandwidth](../../virtual-network/virtual-machine-network-throughput.md#expected-network-throughput). You don't need multiple NICs in order to achieve the expected network throughput. While it's common to use [general purpose VMs](../../virtual-machines/sizes-general.md) with Azure Files, various VM types are available depending on your workload needs and region availability. For more information, see [Azure VM Selector](https://azure.microsoft.com/pricing/vm-selector/).
8486

85-
#### Keep queue depth less than or equal to 64
86-
Queue depth is the number of pending I/O requests that a storage resource can service. We don't recommend exceeding the optimal queue depth of 64. If you do, you won't see any more performance gains. For more information, see [Queue depth](understand-performance.md#queue-depth).
87+
Depending on your workload requirements, it’s important to correctly size the client virtual machines (VMs) to avoid being restricted by their [expected network bandwidth](../../virtual-network/virtual-machine-network-throughput.md#expected-network-throughput). You don't need multiple network interface controllers (NICs) in order to achieve the expected network throughput. While it's common to use [general purpose VMs](../../virtual-machines/sizes-general.md) with Azure Files, various VM types are available depending on your workload needs and region availability. For more information, see [Azure VM Selector](https://azure.microsoft.com/pricing/vm-selector/).
88+
89+
#### Keep queue depth less than or equal to 64
90+
91+
Queue depth is the number of pending I/O requests that a storage resource can service. We don't recommend exceeding the optimal queue depth of 64 because you won't see any more performance gains. For more information, see [Queue depth](understand-performance.md#queue-depth).
92+
93+
### `Nconnect` per-mount configuration
8794

88-
### `Nconnect` per-mount configuration
8995
If a workload requires mounting multiple shares with one or more storage accounts with different `nconnect` settings from a single client, we can't guarantee that those settings will persist when mounting over the public endpoint. Per-mount configuration is only supported when a single Azure file share is used per storage account over the private endpoint as described in Scenario 1.
9096

91-
#### Scenario 1: (supported) `nconnect` per-mount configuration over private endpoint with multiple storage accounts
97+
#### Scenario 1: `nconnect` per-mount configuration over private endpoint with multiple storage accounts (supported)
9298

9399
- StorageAccount.file.core.windows.net = 10.10.10.10
94100
- StorageAccount2.file.core.windows.net = 10.10.10.11
95101
- `Mount StorageAccount.file.core.windows.net:/StorageAccount/FileShare1 nconnect=4`
96102
- `Mount StorageAccount2.file.core.windows.net:/StorageAccount2/FileShare1`
97103

98-
#### Scenario 2: (not supported) `nconnect` per-mount configuration over public endpoint
104+
#### Scenario 2: `nconnect` per-mount configuration over public endpoint (not supported)
99105

100106
- StorageAccount.file.core.windows.net = 52.239.238.8
101107
- StorageAccount2.file.core.windows.net = 52.239.238.7
@@ -106,7 +112,7 @@ If a workload requires mounting multiple shares with one or more storage account
106112
> [!NOTE]
107113
> Even if the storage account resolves to a different IP address, we can't guarantee that address will persist because public endpoints aren't static addresses.
108114
109-
#### Scenario 3: (not supported) `nconnect` per-mount configuration over private endpoint with multiple shares on single storage account
115+
#### Scenario 3: `nconnect` per-mount configuration over private endpoint with multiple shares on single storage account (not supported)
110116

111117
- StorageAccount.file.core.windows.net = 10.10.10.10
112118
- `Mount StorageAccount.file.core.windows.net:/StorageAccount/FileShare1 nconnect=4`
@@ -117,7 +123,7 @@ If a workload requires mounting multiple shares with one or more storage account
117123

118124
We used the following resources and benchmarking tools to achieve and measure the results outlined in this article.
119125

120-
- **Single client:** Azure Virtual Machine ([DSv4-Series](../../virtual-machines/dv4-dsv4-series.md#dsv4-series)) with single NIC
126+
- **Single client:** Azure VM ([DSv4-Series](../../virtual-machines/dv4-dsv4-series.md#dsv4-series)) with single NIC
121127
- **OS:** Linux (Ubuntu 20.40)
122128
- **NFS storage:** Azure Files premium file share (provisioned 30 TiB, set `nconnect=4`)
123129

@@ -194,11 +200,12 @@ When using the `nconnect` mount option, you should closely evaluate workloads th
194200
- Latency sensitive write workloads that are single threaded and/or use a low queue depth (less than 16)
195201
- Latency sensitive read workloads that are single threaded and/or use a low queue depth in combination with smaller I/O sizes
196202

197-
Not all workloads require high-scale IOPS or throughout performance. For smaller scale workloads, `nconnect` might not make sense. Use the following table to decide whether `nconnect` will be advantageous for your workload. Scenarios highlighted in green are recommended, while those highlighted in red are not. Those highlighted in yellow are neutral.
203+
Not all workloads require high-scale IOPS or throughout performance. For smaller scale workloads, `nconnect` might not make sense. Use the following table to decide whether `nconnect` is advantageous for your workload. Scenarios highlighted in green are recommended, while scenarios highlighted in red aren't. Scenarios highlighted in yellow are neutral.
198204

199205
:::image type="content" source="media/nfs-performance/nconnect-latency-comparison.png" alt-text="Screenshot showing various read and write I O scenarios with corresponding latency to indicate when nconnect is advisable." border="false":::
200206

201207
## See also
202-
- For mounting instructions, see [Mount NFS file Share to Linux](storage-files-how-to-mount-nfs-shares.md).
203-
- For a comprehensive list of mount options, see [Linux NFS man page](https://linux.die.net/man/5/nfs).
204-
- For information on latency, IOPS, throughput, and other performance concepts, see [Understand Azure Files performance](understand-performance.md).
208+
209+
- [Mount NFS file Share to Linux](storage-files-how-to-mount-nfs-shares.md)
210+
- [List of mount options](https://linux.die.net/man/5/nfs)
211+
- [Understand Azure Files performance](understand-performance.md)

0 commit comments

Comments
 (0)