Azure Storage File share is not the first option that comes to mind for transactional storage, but I didn’t have data on its performance. Which brought me to produce it, and compare to other storage solutions: “local” storage on agent with different VM skus, within virtual nodes1, Azure Storage File Share standard and premium, and Azure Disks standard and premium.
Let’s get it out of the way: unless there is a very good reason, to maximize performance and lower cost, solutions being built for Kubernetes (and more particularly AKS) should target cloud-native storage solutions: blob storage, Cosmos DB, Azure SQL, etc. This is not always an option though, particularly when integrating solutions like Lucene, or lifting older applications.
The findings and conclusions in this post cover the latter situation: what performance to expect if a file API has to be used for the application, based on the solution being chosen.
On average, if throughput is a concern, disk-based solutions provide more consistent, and better results. If possible (mostly if the data is transient), use agent’s disks. These are the results on 1Mb files:
If applications are write and read intensive (lots of small files), do not use Azure File-Share as the storage solution. They seem to underperform on both read and write. Instead, use disks. These are the results on 10kb files:
For applications storing larger files and are mostly write, file shares might work. These are the results on 100Mb files:
- The size of the files being written has an impact on consistency. Large files tend to produce higher and more consistent bandwidth. Smaller files produce slower and less predictable bandwidth, especially on read. I’m guessing this is mostly due to access time more than bandwidth itself.
- Write bandwidth is more predictable than read. The same test can yield average read bandwidths that are up to double from one run to the next, especially on smaller files. I’m assuming this is partly due to caching.
Smaller files and larger files exhibit somewhat different findings.
- Write bandwidth is “relatively” similar for all options I’ve tried, the fastest option (on agent,
DS2v2) is “only” 3 to 4 times faster than the slowest option (standard file share).
- Read bandwidth is similar when reading on agent, surprisingly so for either standard or premium disks.
- File share is 40 times slower for reading than the fastest option.
- v2 series seem to be faster at writing, v3 series seem to be faster at reading.
Non-Sseries (traditional hard drives) are faster both on read and write for large files.
Much more varied results on smaller files (10kb and 100kb):
- File share is several orders of magnitude slower than the fastest options for reading small files (369 times slower for 100kb files, 1400 times slower for 10kb files.)
- Disks attached as Persistent Volumes are between 10% and 20% slower than reading on agent, standard gave me results much faster than writing on agent. My conclusion here is that giving the levels of consistency I’ve observed, I would just assume no noticeable difference between disks on agent and disks on persistent volume.
- Virtual nodes are, surprisingly, the fastest option for reading on agent. I’m guessing there’s a lot of caching involved.
- What really surprised me is that Premium disks as Persistent Volumes were consistently slower than standard in my tests. I double checked everything, I don’t really understand this result.
- VM in
Sis between 40% and 50% faster for reading than
non-Sversion (D2 v3 vs D2s v3). For writing, this jumps to a 4 times difference:
- VM in v2 series is between 10% and 15% faster than v3 for both reading and writing.
I have used two methods:
ddand writing 1GB from
/dev/zeroonto a file, then reading the file into
/dev/null. This is not necessarily very representative of a transactional load, but that already gives some details on pure throughput. Since the results were consistent with 2), I only used the second solution, which worked better at a larger scale.
using a small utility I built (sources on GitHub) that simulates:
- writing a bunch of files a number of times
- reading a bunch of files a number of times
- writing, then reading a bunch of …
- Repeat with various file size and file counts.
The numbers I provide shouldn’t be taken at face-value, the point is more to compare solutions and get an idea of the impact moving from one to another can have.
The options I have tried are:
- Storing on agent
- D2 v3
- D2s v3
- Ds2 v2
- Ds3 v2
- Using Persistent Volumes
- Standard disk
- Premium disk
- Using Azure File Share
- Standard storage account
- Premium file storage
There are other solutions that can be leveraged, top of mind are:
- Azure NetApp files, which I’ve heard are fast.
- Using a VM scale-set as a file-share - which might be faster than Azure FileShare (or not - haven’t tried).
- Using Blob Fuse, which mounts blob storage as a disk. Since this is still pretty experimental, I was hesitant to include it. 2
- Use a more “custom” approach to sync files through blob or another solution - this is also out of scope of this test.
The last thing is that this test doesn’t go for concurrency, which might change the results completely. There are tons of different parameters that might also affect the results, such as other containers on the same agent, CPU and memory usage, network usage, etc.
|Run name||File count||File Size (unit)||Iterations||Write (Mb/s)||Read (Mb/s)||Write/Read (Mb/s)|
Azure Container Instances, referred to as ACI in the rest of the document. ↩
It gave me results that are for intents and purposes identical to the agent it was running on, which tells me I might have done something wrong with the configuration, or that it doesn’t take into account the replication to blob time. So I didn’t show the results here. ↩