The NFS server built into macOS has several settings which can be modified by the administrator of the computer. Select the item NFS Server > Configuration in the left overview column of the control window to display the pane NFS Server Options. It is divided into three parts.
You can return all server settings to Apple’s defaults by clicking the button Reset to defaults. To save the settings, click the button Apply. The button Revert will reset the contents of the window to the previously saved configuration.
The following settings can be modified in the category Features:
Number of NFS service threads (nfsd): This value specifies on how many processes macOS will distribute the tasks of the NFS server. Each task receives mount requests and data transfer requests of the clients.
The pop-up buttons Support TCP and UDP specify which transport protocols the server should offer for its different services: For the NFS service itself (nfsd), the Status service (statd), the Lock service (lockd) and the Remote quota service (rquotad). By default, either TCP or UDP can be used. This can be modified to accept connections via one of the two protocols only. The settings in the column When sending control which transport protocol the server itself should use when contacting other computers. The lock service supports the additional setting of automatically matching its sender transport protocol with the protocol currently used for the NFS service (Match NFS).
Advertise NFS service via Bonjour: This item specifies whether the NFS server is allowed to advertise its existence in the network using Bonjour. Only in this case, the clients will be able to build a list of available NFS servers.
Limit to local Bonjour domain only: If you have chosen to advertise the server via Bonjour, this option will control whether the service should be seen by computers in the local Bonjour domain only.
Let NFS server generate file system modification events: This field is used to control whether macOS should also try to track any changes of any files (by NFS clients) on disk partitions which are shared via NFS (“file system events”). This feature is needed if services like Spotlight or Time Machine are used.
Require mount requests to come from privileged ports: If this item is checked, macOS will accept requests to mount an NFS share only from clients which use a sender port number smaller than 1024. In Unix systems, only privileged processes with root permission have usually the right to use these ports.
Require NFS requests to come from privileged ports: If this item is checked, macOS will accept requests for NFS data transfer only from clients which use a sender port number smaller than 1024. In Unix systems, only privileged processes with root permission have usually the right to use these ports.
Maintain statistics on active NFS users: This option is usually enabled and causes macOS to keep usage statistics which users and computers are currently accessing the server, how long they have been inactive, and how many bytes have been transferred.
Allow client to mount non-folder objects: Under normal conditions, only folders and their contents can be shared. If this option is switched on, non-folder objects, e.g. files, can also be shared if desired.
Report write operations as successful before completion (async mode): This option will grant the server permission to operate in asynchronous mode. It can acknowledge a successful write operation to a client even if it isn’t sure yet whether the data has actually been transferred to a storage device completely. This increases speed but can lead to data loss if the server or its hard drive are not working reliably: If a disk of the server is failing while a client is performing NFS write operations, the client will assume that all data has been stored correctly although this isn’t the case.
Allow status server to accept requests for crash simulations: Setting a check mark for this item will indicate that the NFS host status server (statd) should perform a crash simulation when it receives the diagnostic NFS command SM_SIMU_CRASH.
You can change the port numbers used for the actual NFS server (nfsd) and port numbers of related services, hereby forcing the use of fixed numbers if necessary. A value of 0 will have the effect that port numbers will be determined automatically for the mount server (mountd), host status server (statd), the lock server (lockd) and the remote quota server (rquotad).
The menus at Logging levels specify how verbose the NFS services should record messages about activity and errors in the system logs of macOS. Values of 0 define the default and cause less important messages to be omitted. Higher values will lead to more verbose reports. The actual effects will depend on operating system version. The logs of NFS server, host status server and lock server can be controlled.
The tab item Tuning can be used to modify technical parameters that control the behavior of the NFS server.
Grace period to reclaim locks: If the server has to be restarted for some reason, the service controlling object locks will be in a specific mode after restart, in which it will allow clients to reclaim locks which had been established before the restart. In that time interval, the server will only accept requests for “old” locks. The value specified here defines the duration of this time period.
Time to cache status of monitored hosts: The status of clients requesting locks is stored in cache memory for a certain period, to avoid costly status communication for each lock request. This value specifies the maximum lifetime of a status entry in this cache. A value of 0 will disable the cache.
Time to keep running after last usage for client tasks: Lock requests are processed by the service lockd. When the NFS server has not been in use for a certain time period, macOS will automatically shut down the lockd process to save resources. The value in this field specifies after what time the lockd process should be terminated after the last client has closed its NFS connection.
Time to keep running after NFS server stopped: This value is equivalent to the last one, however it does not apply to closing the last NFS connection, but to shutting down the NFS server.
Maximum number of requests in cache: This value is used to control the size of the request cache. It is the highest number of requests the server can temporarily store.
Maximum number of requests in queue: This value is used to control the size of the queue for the UDP socket of the server. It is the highest number of requests the server can queue in its network buffer.
WARNING: If this value is too high, macOS may be forced to reserve its entire network communication buffer for this queue. This can cause a failure of all network functions.
Time to gather NFSv2 write operations: The server can collect a certain number of write operations which are a result of NFS requests to optimize its performance when accessing hard drives. This value is the maximum time interval in microseconds the server is allowed to delay a write operation for an NFSv2 request. A value of 0 deactivates the gather feature.
Time to gather NFSv3 write operations: This is equivalent to the previous option, but applies to NFS version 3. Because NFSv3 already has write optimization techniques included, write gathering is usually not necessary.
Size of hash table for shares: This parameter controls how many hash table entries the server should use to store its list of shares.