mount recommendations for NFS
Problem to solve
We recommend using soft
for mounting git-data
over NFS in a number of places: ha nfs, ha nfs setup, and scaling
Reasons for using soft
:
- Performance
- Better handling of loss of network connectivity between the client and server; ie: processes don't hang, and 'df' doesn't hang.
TL;DR reasons for not using it:
can cause silent data corruption in certain cases
Customers should make an informed choice. A read of the man page points to hard,intr
as an alternative which has broadly the opposite pros and cons.
Further details
Reasons for not using soft
; long version:
The man page for nfs says:
soft / hard
Determines the recovery behavior of the NFS client after an NFS request times out. If neither option is specified (or if the hard option is specified), NFS requests are retried indefinitely. If the soft option is specified, then the NFS client fails an NFS request after retrans retransmissions have been sent, causing the NFS client to return an error to the calling application.
NB: A so-called "soft" timeout can cause silent data corruption in certain cases. As such, use the soft option only when client responsiveness is more important than data integrity. Using NFS over TCP or increasing the value of the retrans option may mitigate some of the risks of using the soft option.
Using the intr option is preferred to using the soft option because it is significantly less likely to result in data corruption.
It also says:
The intr / nointr mount option is deprecated after kernel 2.6.25
Leading me to wonder how up to date the guidance is, particularly for NFS4.1
netapp knowledge base elaborates further:
The disadvantage is that if your NFS driver caches data and the soft mount times out, your application may not know which writes to the NFS volumes were actually committed to disk.
And SAP recommends against soft
as well, though it doesn't add much more to the man page contents.
Proposal
Call out the choice in our docs of hard
vs soft
and ensure customers make an informed decision.
I think we should recommend hard,intr
by default, and customers should only consider soft
if they can't tolerate the performance impact. But to do so in the knowledge of what the man page says!