Changing NFS qDepth value on ESXi

In large scale environments where NFS datastores are in use, users or VMs running on NFS datastores may face performance issues while accessing the NFS resources.

Well there could be multiple reasons for such performance issues but when it comes to changing the qDepth of the NFS on ESXi hosts, below is the two line script which saves lot of time of vSphere Administrators.

#Author: Mallikarjun Immadi

$vCenterServer = Read-Host "Enter vCenter Server FQDN or IP Address"
Connect-VIserver $vCenterServer
$esxHosts= Get-Cluster "Standalone-Cluster" | Get-VMHost | where {($_.ConnectionState -notlike "notresponding")}
foreach ($esx in $esxHosts) { Get-AdvancedSetting -Entity $esx -Name NFS.MaxQueueDepth | Set-AdvancedSetting -Value '64' -Confirm:$false }

Above script/commands will set the qDepth value to 64. But feel free to modify as per requirement.

Above Script can be downloaded from here.