How to increase the number of threads created by the NFS daemon in RHEL 4, 5 and 6?

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux 4
  • Red Hat Enterprise Linux 5
  • Red Hat Enterprise Linux 6
  • NFS

Issue

  • In case of a NFS server with a high load, it may be advisable to increase the number of the threads created during the nfsd server start up.
  • How to increase the threads created by nfs daemon in Red Hat Enterprise Linux?
  • RPCNFSDCOUNT
  • nfs thread count / nfsd thread count

Resolution

Edit the following line in /etc/sysconfig/nfs

RPCNFSDCOUNT=8

RPCNFSDCOUNT is the number of threads that will be started. Increase this to start more threads.

Diagnostic Steps

To check if there are enough threads started, execute the following command:

cat /proc/net/rpc/nfsd

Review the following line:

th 16 0 2.610 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000

The first number is the total number of NFS server threads started. The second number indicates whether at any time all of the threads were running at once. The remaining numbers are a thread count time histogram.

You may use a script similar to the following to monitor thread usage over time:

while :
do
    date
    grep "^th" /proc/net/rpc/nfsd
    sleep 300
done

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.