Optimizing NFS Performance

If you see performance problems with your NFS fileserver, you should most probably look into the following pages:
I found the most helpful the chapters "5.6. Number of Instances of the NFSD Server Daemon" and "5.7. Memory Limits on the Input Queue" in the NFS Howto. I'll describe how/where to set these in case of Debian.

The number of nfsd instances can be set in this file (in the RPCNFSDCOUNT parameter): /etc/default/nfs-kernel-server.
You've to restart the nfs-kernel-server service for this to take effect:
invoke-rc.d nfs-kernel-server restart

The memory limits can be increased by appending the following lines to the end of the file /etc/sysctl.conf:
net.core.rmem_max=1048576
net.core.wmem_max=1048576

The values are interpreted as number of bytes. Eg. you could set the number of instances to 64 and each queue size to 1 MB. This way each nfsd instance gets 16k for both its read and write queues. You might want to consider setting these a lot higher (and also set TCP memory queue sizes) in case you've significant non-NFS traffic too. Look into linux TCP tuning for further details.

In case of a current (5.x or later) Debian distribution you can create a separate file (eg. /etc/sysctl.d/60-nfs.conf) and put the lines in it (instead of touching the main sysctl config).
You've to (re)start the procps "service" for this to take effect:
invoke-rc.d procps start

("procps" is not an actual service/daemon. It's an init script used by the system to load kernel parameters from the sysctl config files.)