How to get decent NFS performance for workloads like git?

Try to use this Git setting, which makes a huge performance difference on NFS shares:

git config core.preloadindex true

Quote from the documentation available at: https://git-scm.com/docs/git-config#git-config-corepreloadIndex

This can speed up operations like git diff and git status especially on filesystems like NFS that have weak caching semantics and thus relatively high IO latencies. When enabled, Git will do the index comparison to the filesystem data in parallel, allowing overlapping IO’s. Defaults to true.


This article contains some useful tips to tune NFS performance.

Particularly the use of nfsstat -rc to check how many 'retransmission retries' had been happening. If there are too many retries, that means the nfsd daemon ran out of threads to service clients' requests, and you need to increase the number of available threads.

Also, ensure that your VirtualBox instance is not thinly-provisioned; thin provisioned storage on VirtualBox is a significant performance hit when writes happen.