nfsd: too many open connections

  • linux
  • 12月 20, 2014
  • 0 评论

[摘要] 发现nfs线程数不够了,提示要增加一些数量的threads,syslog中有很多如下日志:
[2566628.826692] nfsd: too many open connections, consider increasing the number of threads.

现有的nfsd状态:

#  cat /proc/net/rpc/nfsd 
rc 0 268 742119
fh 0 0 0 0 0
io 2476981939 0
th 8 0 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000
ra 32 30104 0 0 0 0 0 0 0 0 0 71174
net 742701 314 742393 10103960
rpc 742406 310 310 0 0
proc2 18 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
proc3 22 105 71158 0 175642 184711 17103 101277 0 0 0 0 0 0 0 0 0 0 8916 102 202 0 0
proc4 2 101 182991
proc4ops 59 0 0 0 18112 8341 0 0 0 3239 71595 11834 0 0 0 0 107097 0 0 8344 0 5100 0 181968 0 235 5735 4406 0 0 0 652 8342 8344 0 0 134 134 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

原来nfs默认启动了8个thread,应该是不够了,可以手动修改增加一些。

Debian下修改nfs的默认线程数:
# cat /etc/default/nfs-kernel-server
# Number of servers to start up
# RPCNFSDCOUNT=8
RPCNFSDCOUNT=32

重启nfs
/etc/init.d/nfs-kernel-server restart

如果操作系统是CentOS6.x以上,修改nfs的默认线程数方式如下:
vim /etc/sysconfig/nfs
# Number of nfs server processes to be started.
# The default is 8.
#RPCNFSDCOUNT=8
#RPCNFSDCOUNT=32

再看看目前nfs的状况:

# cat /proc/net/rpc/nfsd
rc 0 268 742121
fh 0 0 0 0 0
io 2476981939 0
th 32 0 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000
ra 64 30104 0 0 0 0 0 0 0 0 0 71174
net 742703 316 742393 10132592
rpc 742408 310 310 0 0
proc2 18 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
proc3 22 107 71158 0 175642 184711 17103 101277 0 0 0 0 0 0 0 0 0 0 8916 102 202 0 0
proc4 2 101 182991
proc4ops 59 0 0 0 18112 8341 0 0 0 3239 71595 11834 0 0 0 0 107097 0 0 8344 0 5100 0 181968 0 235 5735 4406 0 0 0 652 8342 8344 0 0 134 134 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

# cat /proc/fs/nfsd/threads
32

# cat /proc/fs/nfsd/pool_threads
32

# cat /proc/fs/nfsd/pool_stats 
# pool packets-arrived sockets-enqueued threads-woken threads-timedout
0 161938 2 92673 0

重启后在syslog日志中在没有发现任何 nfsd: too many open connections 的日志了。

Dec 20 01:54:01 sudops.com kernel: [2566629.577851] nfsd: last server has exited, flushing export cache
Dec 20 01:54:02 sudops.com kernel: [2566630.613091] svc: failed to register lockdv1 RPC service (errno 97).
Dec 20 01:54:02 sudops.com kernel: [2566630.613217] NFSD: Using /var/lib/nfs/v4recovery as the NFSv4 state recovery directory
Dec 20 01:54:02 sudops.com kernel: [2566630.613239] NFSD: starting 90-second grace period

u2

Related Posts

python cx-Oracle 驱动安装

安装oracle驱动 cx-Oracle驱动二进制版本下载地…

Read more

Nginx 在if语句中限制IP访问

一些web服务,出于安全考虑是不想让其他人访问到,除了添加登录用户认证外,还可以使用Nginx限制IP访问,只允许指定IP的用户访问站点或者接口。

Read more

You Missed

GitHub 25K+星标!Onyx:开源可自托管的企业级AI聊天与RAG平台

  • u2
  • 4月 8, 2026
  • 18 views

InternVL-U 统一多模态模型

  • u2
  • 4月 3, 2026
  • 66 views
InternVL-U 统一多模态模型

Everything Claude Code:开源 Agent 性能优化框架

  • u2
  • 3月 31, 2026
  • 82 views

MiroFish:群体智能预测引擎,让未来在数字沙盘中预演

  • u2
  • 3月 29, 2026
  • 122 views

OpenClaw爆火背后:一个值得深思的转折点

  • u2
  • 3月 25, 2026
  • 112 views

担心Todesk,向日葵有漏洞和数据泄露?跟我来体验下完美开源替代工具:RustDesk!

  • u2
  • 3月 20, 2026
  • 112 views