kernel: nfsd: too many open TCP sockets, consider increasing the number of threads

在/var/log/syslog中看到如下報錯:

 

kernel: nfsd: too many open TCP sockets, consider increasing the number of nfsd threads

網上搜了外國的一篇文章這樣說的(紅帽系列):

The threads in question are set in /etc/sysconfig/nfs:

USE_KERNEL_NFSD_NUMBER="4"

 

Debian系列是在 /etc/default/nfs-kernel-server

RPCNFSDCOUNT= 32

我的是CENTOS7 

# cat /etc/sysconfig/nfs |egrep -v "^#|^$"
RPCNFSDARGS=""
RPCNFSDCOUNT=16
RPCMOUNTDOPTS=""
STATDARG=""
SMNOTIFYARGS=""
RPCIDMAPDARGS=""
RPCGSSDARGS=""
GSS_USE_PROXY="yes"
BLKMAPDARGS=""

 

Cause

This message is generated by some rule-of-thumb checking, and should not be taken as a indication of a definite problem.  Rather, it warns of a situation which might cause low performance under load.  The number of TCP connections open to nfsd (nfs server, port 2049) is checked and if the number is considered higher than the server might be able to keep up with, the message is logged.

 

The message is given when connections to the NFS server's port 2049 are greater than  [(number of threads + 3) * 20].  For example, at the default of 4, the message will be logged if connections to port 2049 exceed 140.  The presence of connections does not necessarily mean all of them are currently making requests.  However, it does signify a certain number of NFS clients with file systems mounted, and if many of them were heavily using NFS resources, the NFS Server might not keep up with it's work as promptly as desired.

 

When choosing a new setting, it can sometimes be helpful to manually check the number of nfsd connections, especially over time or at peak work times.  To do so, give the following command (at a terminal on the NFS Server).

 

用這種方法查看有多少nfs 連接:

netstat -nt | grep -c :2049

 

設置的線程值爲32的話,那麼可以允許的最大連接數爲 (32+3)*20 ,也就是700個。可以根據自己的實際環境去設置。

 

 

本文參考自:http://www.novell.com/support/kb/doc.php?id=7010903

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章