Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am working on a development network that uses NFS so that home directories etc can be accessed from any machine. However, NFS is occasionally flaky, causing slowdown/freezing of the machines.

I am working on server-side code, using a development copy running on my machine. It does a lot of filesystem and database access, so make it more responsive, I have moved the files onto the local disk and put a symlink in the original directory on NFS.

But, if NFS is responding poorly, will the symlink act as a bottleneck, preventing quick access to local files? Or will it be cached so as to avoid this problem?

share|improve this question
    
I'd be more worried about "However, NFS is occasionally flaky, causing slowdown/freezing of the machines.". Your sysadmin needs to fix the NFS server (or upgrade it to meet the demands placed on it), or fix your network's "plumbing" (cabling/switches etc). NFS can be annoying when things go wrong, but should run smoothly and stably if there's no underlying hw problem. –  cas Oct 11 '12 at 6:00

2 Answers 2

If NFS has low bandwidth, the symlink probably won't be a bottleneck. If it has latency, you might feel it. If the NFS server goes down, you'll be stranded. So if you need NFS anyway, the symlink won't make a visible difference, but if you're completely off-NFS except for that symlink, it's worth arranging not to use even that symlink.

The local machine can't keep a cache of directory entries because it never knows when a directory entry might be modified on the server or by another NFS client. The NFS client does keep a cache of file contents, which it only uses if the server tells the client that the file's ctime hasn't changed since the cache copy was made.

share|improve this answer

The link should be cached, and links are very small to read over the network anyway, but it depends how busy the NFS server is. It might be better to re-root the application to use all local file systems to get the maximum speed - particularly if you are serving a lot of files for a request that use full pathnames that have to traverse the link. If all pathnames are relative to the root directory though, it may not make any difference once the server has started.

In the end, you need to try it out with and without, but I suspect it would probably be fast enough.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.