Bug 270551 - nfsd ignores vfs.nfsd.maxthreads at startup
Summary: nfsd ignores vfs.nfsd.maxthreads at startup
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 13.1-RELEASE
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-net (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-03-30 20:58 UTC by Alan Somers
Modified: 2023-03-31 01:54 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alan Somers freebsd_committer freebsd_triage 2023-03-30 20:58:52 UTC
The vfs.nfsd.maxthreads sysctl should control the maximum number of threads that the nfs server creates.  Indeed it does, for nfs servers that are already running.  But when nfsd starts up, it ignores this setting.  Instead, it overwrites it based on the value of the --maxthreads argument or else it somehow chooses a sensible default.

This behavior is unfortunate, since /etc/rc.d/sysctl runs before /etc/rc.d/nfsd.  That means you can't use the sysctl to control nfsd's behavior.

Should nfsd check the sysctl if maxthreads is unset, and use that value?

Steps to Reproduce
==================
# echo vfs.nfsd.maxthreads=128 >> /etc/sysctl.conf
# service sysctl restart
# sysctl vfs.nfsd.maxthreads
vfs.nfsd.maxthreads: 128
# service nfsd start
# sysctl vfs.nfsd.maxthreads
vfs.nfsd.maxthreads: 64
Comment 1 Rick Macklem freebsd_committer freebsd_triage 2023-03-30 22:40:17 UTC
I think this should be discussed on a mailing list and
not here in a PR. Please post to whichever list you
think is most appropriate and I will respond there.