Skip to content

Commit d343a39

Browse files
committed
Update usage models
1 parent 2c7e817 commit d343a39

File tree

2 files changed

+24
-60
lines changed

2 files changed

+24
-60
lines changed

articles/hpc-cache/cache-usage-models.md

Lines changed: 18 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
---
22
title: Azure HPC Cache usage models
33
description: Describes the different cache usage models and how to choose among them to set read-only or read/write caching and control other caching settings
4-
author: ekpgh
4+
author: rohogue
55
ms.service: hpc-cache
66
ms.topic: how-to
7-
ms.date: 06/29/2022
7+
ms.date: 02/16/2024
88
ms.author: rohogue
99
---
1010
<!-- filename is referenced from GUI in aka.ms/hpc-cache-usagemodel -->
@@ -17,82 +17,52 @@ Cache usage models let you customize how your Azure HPC Cache stores files to sp
1717

1818
File caching is how Azure HPC Cache expedites client requests. It uses these basic practices:
1919

20-
* **Read caching** - Azure HPC Cache keeps a copy of files that clients request from the storage system. The next time a client requests the same file, HPC Cache can provide the version in its cache instead of having to fetch the file from the back-end storage system again.
20+
* **Read caching** - Azure HPC Cache keeps a copy of files that clients request from the storage system. The next time a client requests the same file, HPC Cache can provide the version in its cache instead of having to fetch the file from the back-end storage system again. Write requests are passed to the back-end storage system.
2121

22-
* **Write caching** - Optionally, Azure HPC Cache can store a copy of any changed files sent from the client machines. If multiple clients make changes to the same file over a short period, the cache can collect all the changes in the cache instead of having to write each change individually to the back-end storage system.
22+
* **Write caching** - Optionally, Azure HPC Cache can store a copy of any changed files sent from the client machines. If multiple clients make changes to the same file over a short period, the cache can collect all the changes in the cache instead of having to write each change individually to the back-end storage system. After a specified amount of time with no changes, the cache moves the file to the long-term storage system.
2323

24-
After a specified amount of time with no changes, the cache moves the file to the long-term storage system.
24+
* **Verification timer** - The verification timer setting determines how frequently the cache compares its local copy of a file with the remote version on the back-end storage system. If the back-end copy is newer than the cached copy, the cache fetches the remote copy and stores it for future requests.
2525

26-
If write caching is disabled, the cache doesn't store the changed file and immediately writes it to the back-end storage system.
26+
The verification timer setting shows when the cache *automatically* compares its files with source files in remote storage. However, you can force Azure HPC Cache to compare files by performing a directory operation that includes a readdirplus request. Readdirplus is a standard NFS API (also called extended read) that returns directory metadata, which causes the cache to compare and update files.
2727

28-
* **Write-back delay** - For a cache with write caching turned on, write-back delay is the amount of time the cache waits for additional file changes before copying the file to the back-end storage system.
29-
30-
* **Back-end verification** - The back-end verification setting determines how frequently the cache compares its local copy of a file with the remote version on the back-end storage system. If the back-end copy is newer than the cached copy, the cache fetches the remote copy and stores it for future requests.
31-
32-
The back-end verification setting shows when the cache *automatically* compares its files with source files in remote storage. However, you can force Azure HPC Cache to compare files by performing a directory operation that includes a readdirplus request. Readdirplus is a standard NFS API (also called extended read) that returns directory metadata, which causes the cache to compare and update files.
28+
* **Write-back timer** - For a cache with read-write caching, write-back timer is the maximum amount of time in seconds that the cache waits before copying a changed file to the back-end storage system.
3329

3430
The usage models built into Azure HPC Cache have different values for these settings so that you can choose the best combination for your situation.
3531

3632
## Choose the right usage model for your workflow
3733

3834
You must choose a usage model for each NFS-protocol storage target that you use. Azure Blob storage targets have a built-in usage model that can't be customized.
3935

40-
HPC Cache usage models let you choose how to balance fast response with the risk of getting stale data. If you want to optimize speed for reading files, you might not care whether the files in the cache are checked against the back-end files. On the other hand, if you want to make sure your files are always up to date with the remote storage, choose a model that checks frequently.
36+
HPC Cache usage models let you choose how to balance fast response with the risk of getting stale data. If you want to optimize speed for reading files, you might not care whether the files in the cache are checked against the back-end files. On the other hand, if you want to make sure your files are always up to date with the remote storage, choose a model and set the verification timer to a low number to check frequently.
4137

4238
These are the usage model options:
4339

44-
* **Read heavy, infrequent writes** - Use this option if you want to speed up read access to files that are static or rarely changed.
40+
* **Read-only caching** - Use this option if you want to speed up read access to files. Choose this option when your workflow involves minimal write operations like 0% to 5%.
4541

46-
This option caches client reads but doesn't cache writes. It passes writes through to the back-end storage immediately.
42+
This option caches client reads but doesn't cache writes. Writes pass through to the back-end storage.
4743

48-
Files stored in the cache are not automatically compared to the files on the NFS storage volume. (Read the description of back-end verification above to learn how to compare them manually.)
49-
50-
Do not use this option if there is a risk that a file might be modified directly on the storage system without first writing it to the cache. If that happens, the cached version of the file will be out of sync with the back-end file.
51-
52-
* **Greater than 15% writes** - This option speeds up both read and write performance. When using this option, all clients must access files through the Azure HPC Cache instead of mounting the back-end storage directly. The cached files will have recent changes that have not yet been copied to the back end.
53-
54-
In this usage model, files in the cache are only checked against the files on back-end storage every eight hours. The cached version of the file is assumed to be more current. A modified file in the cache is written to the back-end storage system after it has been in the cache for an hour with no additional changes.
55-
56-
* **Clients write to the NFS target, bypassing the cache** - Choose this option if any clients in your workflow write data directly to the storage system without first writing to the cache, or if you want to optimize data consistency. Files that clients request are cached (reads), but any changes to those files from the client (writes) are not cached. They are passed through directly to the back-end storage system.
57-
58-
With this usage model, the files in the cache are frequently checked against the back-end versions for updates - every 30 seconds. This verification allows files to be changed outside of the cache while maintaining data consistency.
59-
60-
> [!TIP]
61-
> Those first three basic usage models can be used to handle the majority of Azure HPC Cache workflows. The next options are for less common scenarios.
44+
Files stored in the cache are not automatically compared to the files on the NFS storage volume. (Read the description of verification timer above to learn how to compare them manually.)
6245

63-
* **Greater than 15% writes, checking the backing server for changes every 30 seconds** and **Greater than 15% writes, checking the backing server for changes every 60 seconds** - These options are designed for workflows where you want to speed up both reads and writes, but there's a chance that another user will write directly to the back-end storage system. For example, if multiple sets of clients are working on the same files from different locations, these usage models might make sense to balance the need for quick file access with low tolerance for stale content from the source.
46+
When choosing the **Read-only caching** option, you may change the Verification timer. The default value is 30 seconds. The value must be an integer (no decimals) between 1 and 31536000 seconds (1 year) inclusive.
6447

65-
* **Greater than 15% writes, write back to the server every 30 seconds** - This option is designed for the scenario where multiple clients are actively modifying the same files, or if some clients access the back-end storage directly instead of mounting the cache.
48+
* **Read-write caching** - This option caches both read and write operations. When using this option, most clients are expected to access files through the Azure HPC Cache instead of mounting the back-end storage directly. The cached files will have recent changes that have not yet been copied to the back end.
6649

67-
The frequent back-end writes affect cache performance, so you should consider using the **Greater than 15% writes** usage model if there's a low risk of file conflict - for example, if you know that different clients are working in different areas of the same file set.
50+
In this usage model, files in the cache are only checked against the files on back-end storage every eight hours by default. The cached version of the file is assumed to be more current. A modified file in the cache is written to the back-end storage system after it has been in the cache for an hour by default.
6851

69-
* **Read heavy, checking the backing server every 3 hours** - This option prioritizes fast reads on the client side, but also refreshes cached files from the back-end storage system regularly, unlike the **Read heavy, infrequent writes** usage model.
52+
When choosing the **Read-write caching** option, you may change both the Verification timer and the Write-back timer. The Verification timer default value is 28,800 seconds (8 hours). The value must be an integer (no decimals) between 1 and 31536000 inclusive. The Write-back timer default value is 3600 seconds (1 hour). The value must be an integer (no decimals) between 1 and 31536000 seconds (1 year) inclusive.
7053

7154
This table summarizes the usage model differences:
7255

7356
[!INCLUDE [usage-models-table.md](includes/usage-models-table.md)]
7457

58+
> [!WARNING]
59+
> **Changing usage models causes a service disruption.** HPC Cache clients will not receive responses while the usage model is transitioning. If you must change usage models, it is recommended that the change is made during a scheduled maintenance window to prevent client disruption.
60+
7561
If you have questions about the best usage model for your Azure HPC Cache workflow, talk to your Azure representative or open a support request for help.
7662

7763
> [!TIP]
7864
> A utility is available to write specific individual files back to a storage target without writing the entire cache contents. Learn more about the flush_file.py script in [Customize file write-back in Azure HPC Cache](custom-flush-script.md).
7965
80-
## Change usage models
81-
82-
You can change usage models by editing the storage target, but some changes are not allowed because they create a small risk of file version conflict.
83-
84-
You can't change **to** or **from** the model named **Read heavy, infrequent writes**. To change a storage target to this usage model, or to change it from this model to a different usage model, you have to delete the original storage target and create a new one.
85-
86-
This restriction also applies to the usage model **Read heavy, checking the backing server every 3 hours**, which is less commonly used. Also, you can change between the two "read heavy..." usage models, but not into or out of a different usage model style.
87-
88-
This restriction is needed because of the way different usage models handle Network Lock Manager (NLM) requests. Azure HPC Cache sits between clients and the back-end storage system. Usually, the cache passes NLM requests through to the back-end storage system, but in some situations, the cache itself acknowledges the NLM request and returns a value to the client. In Azure HPC Cache, this only happens when you use the usage models **Read heavy, infrequent writes** or **Read heavy, checking the backing server every 3 hours**, or with a standard blob storage target, which doesn't have configurable usage models.
89-
90-
If you change between **Read heavy, infrequent writes** and a different usage model, there's no way to transfer the current NLM state from the cache to the storage system or vice versa. So the client's lock status is inaccurate.
91-
92-
> [!NOTE]
93-
> ADLS-NFS does not support NLM. You should disable NLM when clients mount the cluster to access an ADLS-NFS storage target.
94-
>
95-
> Use the option ``-o nolock`` in the ``mount`` command. Check your client operating system's mount documentation (man 5 nfs) to learn the exact behavior of the ``nolock`` option for your clients.
9666

9767
## Next steps
9868

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,12 @@
11
---
22
ms.service: hpc-cache
33
ms.topic: include
4-
ms.date: 06/17/2021
5-
author: ekpgh
6-
ms.author: v-erkel
4+
ms.date: 02/16/2024
5+
author: rohogue
6+
ms.author: rohogue
77
---
88

9-
10-
| Usage model | Caching mode | Back-end verification | Maximum write-back delay |
9+
| Usage model | Caching mode | Verification timer | Write-back timer |
1110
|--|--|--|--|
12-
| Read heavy, infrequent writes <!--read_heavy_infreq-->| Read | Never | None |
13-
| Greater than 15% writes <!--write_workload_15-->| Read/write | 8 hours | 1 hour |
14-
| Clients bypass the cache <!--write_around-->| Read | 30 seconds | None |
15-
| Greater than 15% writes, frequent back-end checking (30 seconds) <!--write_workload_check_30-->| Read/write | 30 seconds | 1 hour |
16-
| Greater than 15% writes, frequent back-end checking (60 seconds) <!--write_workload_check_60-->| Read/write | 60 seconds | 1 hour |
17-
| Greater than 15% writes, frequent write-back <!--write_workload_cloudws-->| Read/write | 30 seconds | 30 seconds |
18-
| Read heavy, checking the backing server every 3 hours <!--read_heavy_check_180-->| Read | 3 hours | None |
11+
| Read-only caching <!--READ_ONLY-->| Read | 30 seconds | None |
12+
| Read-write caching <!--READ_WRITE-->| Read/write | 8 hours | 1 hour |

0 commit comments

Comments
 (0)