Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Can you speak to any stale NFS handle problems?

I've used NFS at home and have had NFS file handle problems but IIRC that was only when there were problems like kernel faults or network partitions.

However several of my colleagues at work have many NFS horror stories and are adamant that NFS does not scale well.

Is NFS stability at scale simply a function of your underlying network and infrastructure stability in your opinion?



Unlike typical local Unix file systems, NFS does not support "delete on last close" semantics.

Ordinarily, even if you unlink a file, the operating system keeps the inode around until the last filehandle referencing it goes away. But an NFS mount cannot know when all filehandles on all networked systems have closed. When you attempt to read from an NFS file handle whose underlying file has been deleted out from under you, BOOM -- `ESTALE`.

The solution is typically to guard against file deletion using read locks... which are extremely annoying to implement on NFS because of portability issues and cache coherency problems.

I'm not sure I'd describe that as a "scaling problem" per se, because it gets bad quickly and stays bad. It's more of a severe limitation on how applications and libraries can design their interaction with the file system.


Doesn't NFS rename deleted files to some temp name so other clients can still read and write to it using their existing file handle?


some implementations of NFS use "silly rename" to get delete on last close semantics. http://nfs.sourceforge.net/#faq_d2

I think that's limited to v2/v3 and not fully general or reliable.


Having a low latency network is key (e.g. LAN across an office or maybe a city should be fine, but WAN across country would be bad news).

Hard coding the fsid's on the server side can help if you change your exports a lot.

Using the automounter can help, although it does not scale to large numbers of mounts well.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: