内核 NFS 模块是否有并发限制?

Do kernel NFS module have concurrent limit?

背景:我正在使用 fio 测试 nfs 服务器。而且我发现不管"iodepth"设置多少都变成了fio。 nfs-server 只能有“64 Inflight”。所以我只是怀疑 "nfs protocol" 附近的某个地方限制了最大并发(飞行中的最大 io)。

fio 命令是

fio -numjobs=1 -iodepth=128 -direct=1 -ioengine=libaio -sync=1 -rw=write -bs=4k -size=500M -time_based -runtime=90 -name=Fiow -directory=/75

我的 nfs-server 是基于 ganesha 的,使用 ganesha_stats.py.

得出结论“64 Inflight”

所以我现在有两个选择:

  1. 研究调用图并阅读代码以找到问题

    1. 我下载 linux 内核代码,但很难 .我应该从哪个 function/source 文件开始,也许 vfs.c:nfsd_write?
    2. 尝试使用 'perf' 跟踪调用图来加快我对 linux 内核的代码阅读之旅,但失败了。因为 'perf report' 显示没有函数名的共享库符号。
  2. 学习nfs protocol/mount cmd求极限。

有人可以帮我解决这个问题吗? :)

假设您使用的是 NFSv4.1 (RFC 5661):

In NFSv4.1, the number of outstanding requests is bounded by the size of the slot table [...].

并且在 Linux 中:

#define NFS4_DEF_SLOT_TABLE_SIZE (64U)

这是 this module param 的默认值:

module_param(max_session_slots, ushort, 0644);
MODULE_PARM_DESC(max_session_slots, "Maximum number of outstanding NFSv4.1 "
        "requests the client will negotiate");

IIUC total maximum 对于这个是:

#define NFS4_MAX_SLOT_TABLE (1024U)