Debian 上的 NFS 性能问题

Kyl*_*e M 9 networking linux nfs

我在两台喘息的机器之间使用 NFS 的性能非常不一致,我似乎无法确定它。

设置:

机器 1 'video1':双 5506 w/12GB ram,8x3TB RAID6 上的 XFS 从 '/mnt/storage' 导出为 'video1'

机器 2 'storage1':Phenom X2 @ 3.2Ghtz w/8GB ram,5x2TB 上的 ZFS 从 /mnt/storage1-storage 导出为“storage1”

本地写入性能:

mackek2@video1:/mnt/storage/testing$ dd if=/dev/zero of=localwrite10GB bs=5000k count=2000
2000+0 records in
2000+0 records out
10240000000 bytes (10 GB) copied, 16.7657 s, 611 MB/s
Run Code Online (Sandbox Code Playgroud)

本地读取性能:

两者都连接到同一个 HP 千兆交换机,iperf 双向提供坚如磐石的 940mbps。

我的问题是,当我从 storage1 写入 video1 导出时,性能无处不在。似乎在文件传输的前几 (5-7) 场演出中(我希望尽可能快地移动 30-120GB AVCHD 或 MJPEG 文件),性能从 900mbps 下降到 150-180mbps,所以时间为慢到 30mbps。如果我重新启动 NFS 内核服务器,性能会恢复到更多的演出。

mackek2@storage1:/mnt/video1/testing$ dd if=/dev/zero of=remoteWrite10GB count=2000 bs=5000K
2000+0 records in
2000+0 records out
10240000000 bytes (10 GB) copied, 223.794 s, 45.8 MB/s
mackek2@storage1:/mnt/video1/testing$ dd if=/dev/zero of=remoteWrite10GBTest2 count=2000 bs=5000K
2000+0 records in
2000+0 records out
10240000000 bytes (10 GB) copied, 198.462 s, 51.6 MB/s
mackek2@storage1:/mnt/video1/testing$ dd if=/dev/zero of=bigfile776 count=7000 bs=2000K
7000+0 records in
7000+0 records out
14336000000 bytes (14 GB) copied, 683.78 s, 21.0 MB/s
mackek2@storage1:/mnt/video1/testing$ dd if=/dev/zero of=remoteWrite15GB count=3000 bs=5000K
3000+0 records in
3000+0 records out
15360000000 bytes (15 GB) copied, 521.834 s, 29.4 MB/s
Run Code Online (Sandbox Code Playgroud)

当事情进展很快时,客户端上的 nfsiostat 给出的平均 RTT 为几毫秒,但一旦性能下降,它就会迅速增加超过 1.5 秒的 RTT。此外,在写入过程中,CPU 队列深度跃升至 8 以上。

现在,当从同一个出口读取时,我得到了漂亮的 890Mbps,整个读取速度为 mbps。

mackek2@storage1:/mnt/video1/testing$ dd if=remoteWrite10GBTest2 of=/dev/null
20000000+0 records in
20000000+0 records out
10240000000 bytes (10 GB) copied, 89.82 s, 114 MB/s
mackek2@storage1:/mnt/video1/testing$ dd if=remoteWrite15GB of=/dev/null
30000000+0 records in
30000000+0 records out
15360000000 bytes (15 GB) copied, 138.94 s, 111 MB/s
Run Code Online (Sandbox Code Playgroud)

将 storage1 作为 NFS 服务器,反过来也会发生同样的事情。CPU 队列跳起来,速度下降到废话,我把头发拉出来。

我曾尝试将 NFS 守护进程的数量增加到 64 个,但在几次演出后它仍然会出现问题。

Chr*_*ell 4

您不包括安装或导出选项,因此 NFS 的许多因素可能会影响性能。我建议尝试以下选项以获得最大的 NFS 性能和可靠性(根据我的经验):

  • 安装选项: tcp,hard,intr,nfsvers=3,rsize=32768,wsize=32768

  • 导出选项: async