AzureFile Persistent volume performance is too slow

1.1k Views Asked by At

We are using this AKS cluster to host our Azuredevops build agents as docker containers. We followed the Microsoft documents We followed this link to https://learn.microsoft.com/en-us/azure/devops/pipelines/agents/docker?view=azure-devops to setup the ADO agents, to set this agents ready, however we are facing some performance and stability issue with the ADO agent usages.

We referred the MS Document to setup fileshare based Persistent Volume to use across multiple pods of aks agents and pointed this PV volume as maven and node cached repository for the Builds. But the builds are much slower than the normal (4X times slower) . We are using Storage account [Standard Geo-redundant storage (GRS)]fileshare with Private endpoint. But When we used the Azure-disk as Persistent volume,, the builds are faster. But Disk based PVs cant be mount across multiple nodes . So why this performance issue is happening for fileshare based PV and what will be the recommended solution?

Or can we have the Azuredisk shared between multiple nodes ?

apiVersion: v1
kind: PersistentVolume
metadata:
  name: my-pv
spec:
  capacity:
    storage: 100Gi
  accessModes:
    - ReadWriteMany
  persistentVolumeReclaimPolicy: Retain
  csi:
    driver: file.csi.azure.com
    readOnly: false
    volumeHandle: unique-volumeid  # make sure this volumeid is unique in the cluster
    volumeAttributes:
      resourceGroup: my-rg
      shareName: aksshare
    nodeStageSecretRef:
      name: azure-secret
      namespace: ado
  mountOptions:
    - dir_mode=0777
    - file_mode=0777
    - uid=0
    - gid=0
    - mfsymlinks
    - cache=strict
    - nosharesock
    - nobrl

#############################

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: my-pvc
spec:
  accessModes:
    - ReadWriteMany
  storageClassName: ""
  volumeName: my-pv
  resources:
    requests:
      storage: 100Gi             

#############################

apiVersion: v1
data:
  azurestorageaccountkey: ''
  azurestorageaccountname: ''
kind: Secret
metadata:
  name: azure-secret
  namespace: aks
type: Opaque
2

There are 2 best solutions below

1
On

I suggest using Premium file shares. Their performance is much better than the standard tier.

If you are using the out of box storage classes, then use the "azurefile-csi-premium" storage class.

If you are using your own storage class, then add the following to the end of the storage class definition (After creating the premium share):

parameters:
  skuName: Premium_LRS

References:

Azure Files scalability and performance targets

Azure File Dynamic

Azure File Static

1
On

While Premium tier may produce better performance, especially if you choose to go the NFS route, please be aware that the Premium tier file shares have a minimum size of 100Gi.

So even though your PVC may report something small like 2Gi you will be billed for 100Gi.

Source: https://learn.microsoft.com/en-us/azure/storage/files/understanding-billing