CuriousMind
CuriousMind

Reputation: 15788

No such file or directory on busy NFS

I am working on a network file system. I realize when I kick off many processes that read/write the file system in parallel, I frequently get the "no such file or directory" error. Even the file exists, and the error is not reproducible. Oh and I am even writing to the file, which makes it less sense to even complain.

I wonder if there could be something in NFS that chokes when it gets busy? How do I avoid this kind of problem from application development side?

Thanks

Upvotes: 1

Views: 899

Answers (1)

Kevin Seifert
Kevin Seifert

Reputation: 3572

I'd try running the process on a standard file system first to see if nfs is an issue (eg, copy the nfs data to /tmp/test) or an application issue.

I'd be more inclined to think the software itself is hitting some type of race condition. If a file does not exist, ideally the software should sleep, and retry a few times before giving up.

With parallel processing, there's also a good chance some files are being accessed while they are being changed or created. Is the software itself threadsafe? It might need to lock and release resources.

As far as NFS, you might look at the mount options in /etc/fstab, if it's mounted. Some options (like sync/async) could possibly affect the issue. Also, linux itself will buffer disk writes in memory (since the disk is slow).

Upvotes: 1

Related Questions