Php – Does a read on a NFS file system slow performance

file-sharingionfsperformancePHP

If a NFS client reads a file, does any network traffic happen? or is it just writes (by any node) that result in network traffic?

In particular, I'm interested in whether doing a file_exists() call in a PHP script will be more expensive if the target file is on NFS than if the target file is on the native file system?


For reference, this is my NFS configuration:

Server /etc/exports:

/var/www/staging/uploads 192.168.0.1(rw,sync,no_root_squash)

Client /etc/fstab:

192.168.0.1:/var/www/staging/uploads /var/www/staging/uploads nfs soft,intr,rsize=8192,wsize=8192

Best Answer

Reads will cause traffic. file stat() calls will cause traffic. Clients have a cache, but it is very short-lived and is really not something one can rely on.

No one ever accused NFS of being fast and efficient, although it can be tuned.