8

What do I need to do to change the RPCNFSDCOUNT setting without a full service restart?

I need to reload the NFS configuration without restarting the service. The RPCNFSDCOUNT thread count is too low for the workload but I cannot get the management to agree on a schedule for a change window.

A normal service can frequently do this with a SIGHUP. I did attempt this with a kill -HUP $(pidof rpc.mountd), but that was unsuccessful in getting the new RPCNFSDCOUNT setting applied from /etc/sysconfig/nfs on this old Fedora 8 box.

The man pages for the other NFS daemons incline me to think that HUP'ing those processes won't be of any benefit, and I'm rather reluctant to HUP the kthreadd process that is the parent process of the nfsd threads themselves.

2 Answers 2

8

And after an obvious mental lapse, I remembered the /proc filesystem. /proc/fs/nfsd, specifically, controls the runtime settings of the nfsd service.

In my case, this meant echo '32' > /proc/fs/nfsd/threads sets the number of threads to 32.

5

You can execute rpc.nfsd from the command line and specify the number of processes to add or remove if the nfs server is already running.

From man 8 rpc.nfsd

/usr/sbin/rpc.nfsd [options] nproc

Note that if the NFS server is already running, then the options for
specifying host, port, and protocol will be ignored.  The number of 
processes given will be  the  only option  considered,  and  the  number
of  active nfsd processes will be increased or decreased to match this 
number. In particular rpc.nfsd 0 will stop all  threads  and thus close 
any open connections.
2
  • Actually, at least with Fedora 8, 'service nfs reload' ONLY runs exportfs -r per the /etc/init.d/nfs script.
    – Magellan
    Commented May 9, 2012 at 17:07
  • @Adrian You are right. See my edit.
    – George M
    Commented May 9, 2012 at 17:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .