Managing NFS and NIS, 2nd Edition - Mike Eisler [275]
Write-behind is a performance win, because the NFS client must synchronize dirty data to the server before the application closes the file. A sequential write pattern is not necessary to leverage the benefits of multiple write-behind threads.
Setting too many of these threads has the following risks:
If there are lots of mounted filesystems, consuming kernel memory for lots of threads could degrade system performance.
If the network link or the NFS server is slow, the network can become saturated.
nfs3_max_transfer_size
Controls the default I/O transfer size for NFS Version 3 mounts.
Given that UDP datagrams are limited to a maximum of 64 KB, adjusting this value beyond its default is dangerous. If you do raise it from its default (32 KB for Solaris, at the time of this writing), make sure that you specify the use of the TCP protocol for all NFS mounts.
nfs_nra
(NFS Version 2)
nfs3_nra
(NFS Version 3)
Controls the number of blocks the NFS filesystem will read ahead at a time once it detects a sequential read pattern.
This is a parameter that can have diminishing returns if set too high. Not only will sequential read performance not improve, but the increased memory use by the client will ultimately degrade overall performance of the system.
If the read pattern is dominated by random and not sequential reads (as might be the case when reading indexed files), setting this tunable to 0 (zero) might be a win.
nfs_shrinkreaddir
This is a parameter that is for enhancing interoperability. Many NFS implementations were based on early source code from Sun Microsystems. This code reads directories in buffers that were much smaller (1038 bytes) than the maximum transfer size. Later, when Sun changed Solaris NFS clients to read directories using maximum transfer sizes, it was found that some servers could not cope.
Set this parameter to 1 to force 1038-byte directory read transfers.
nfs_write_error_to_cons_only
Controls whether NFS write errors are logged to the system console only, or to the console and syslog. By default, errors are logged to both the console and syslog.
This is a security issue. The syslog setup usually logs errors to a file that is globally readable in /var/adm directory. Write errors often include the file handle of the file on which the error was encountered. If the file handle can be easily obtained, it is easier for attackers to attack the NFS server, since they can bypass the NFS filesystem to mount such attacks.
rsize
wsize
These are suboptions to the NFS mount command that change read and write transfer block sizes, respectively.
For NFS Version 2 mounts, the maximum is limited to 8KB, per the NFS Version 2 protocol definition.
For NFS Version 3 mounts, the same caveats for the nfs3_max_transfer_size parameter apply.
-t timeout
This is an option to the automount command that sets the number of seconds the automounter will wait before attempting to unmount a filesystem. Since unmounting a filesystem often forces the premature flushing of buffers and release of performance enhancing caches, higher values of this parameter can have very beneficial effects.
If your NFS server performs additional functions, like electronic mail, or it allows users to login to run applications, then it is likely your NFS server will be a heavy client of the automounter, even if the filesystems are local to the NFS server. While you are better off making your NFS servers do only NFS service, if you must allow the NFS server to do non-NFS things, you are strongly encouraged to increase the automounter timeout.
Lowering the timeout from its default value is almost always a bad idea, except when you have lots of unreliable servers or networks. In that case, more frequent unmounting of automounted filesystems might be a net win.
Table C-2. Server Parameters
Parameter
Description
Caveats
nfs_portmon
This parameter