Slow Performance on NFS Mount with Caching Disabled
search cancel

Slow Performance on NFS Mount with Caching Disabled

book

Article ID: 297991

calendar_today

Updated On:

Products

VMware Tanzu Application Service for VMs

Issue/Introduction

Attribute caching is disabled by default in recent versions of the NFS service.

This means that default mounts will be created with the option "actimeo=0" which sets the following options all to 0 also, to disable caching: acregminacregmaxacdirmin, acdirmax

This can cause a decrease in performance for read/write mounts and the app instances using them.

Note: Caching is enabled by default for read-only mounts


Environment

Product Version: 2.7

Resolution

A new 'cache' attribute has been added to the latest versions of nfs-volume release which allows the operator to create NFS services with caching enabled if required.

Services with caching enabled can be created as follows:
cf create-service nfs Existing SERVICE-INSTANCE-NAME -c '{"share":"SERVER/SHARE", "cache": 
true}'
This creates a mount without the "actimeo=0" attribute described above and thus disables caching for the mount. The same attribute can be set on a bind-service command.

The 'cache' attribute is available in the following releases of Tanzu Application Service for VMs:
  • TAS 2.9.4+
  • TAS 2.7.18, 2.8.12
A temporary workaround to enable caching is available for the following versions - this is recommended only if you wish to test that performance issues are mitigated when caching is enabled:
  • TAS 2.7.16 
  • TAS 2.7.17
  • TAS 2.8.10
  • TAS 2.8.11
Steps:
  1. SSH to a clock_global VM:
    1. bosh -d <cf-dep> ssh clock_global/0
  2. Edit the start.sh script to add 'cache' to the allowed options list:
    1. cd /var/vcap/jobs/nfsbrokerpush
    2. vim start.sh
    3. allowedOptions="source,uid,gid,auto_cache,readonly,version,mount" change to allowedOptions="source,uid,gid,auto_cache,readonly,version,mount,cache"
  3. Exit the VM and run the nfsbrokerpush errand:
    1. bosh -d <cf-dep> run-errand nfsbrokerpush --instance=clock_global/0
  4. Then test creating and binding with "cache": true and check performance.
Note: This workaround change is not persistent - if TAS is upgraded (reversing the clock_global change) or the nfsbrokerpush errand is run against a non-edited clock_global, the cache option will not be recognized and new service instances will fail to create with caching enabled.