linux – NFS客户端具有不平衡的读写速度

linux – NFS客户端具有不平衡的读写速度,第1张

概述我有一台NetApp作为我的nfs服务器,两台 Linux服务器作为nfs客户端.问题是,两台服务器中较新的服务器在同时对nfs服务器进行读写 *** 作时,读写速度会有很大差异.另外,读取和写入对于这个新服务器看起来很棒.旧服务器没有此问题. 老主持人:鲤鱼 Sun Fire x4150带有8核,32 GB RAM SLES 9 SP4 网络驱动程序:e1000 me@carp:~> uname -a 我有一台NetApp作为我的nfs服务器,两台 Linux服务器作为nfs客户端.问题是,两台服务器中较新的服务器在同时对nfs服务器进行读写 *** 作时,读写速度会有很大差异.另外,读取和写入对于这个新服务器看起来很棒.旧服务器没有此问题.

老主持人:鲤鱼

Sun Fire x4150带有8核,32 GB RAM

SLES 9 SP4

网络驱动程序:e1000

me@carp:~> uname -alinux carp 2.6.5-7.308-smp #1 SMP Mon Dec 10 11:36:40 UTC 2007 x86_64 x86_64 x86_64 GNU/linux

新主持人:辣椒

HP Proliant Dl360P Gen8具有8核,64 GB RAM

CentOS 6.3

网络驱动程序:tg3

me@pepper:~> uname -alinux pepper 2.6.32-279.el6.x86_64 #1 SMP Fri Jun 22 12:19:21 UTC 2012 x86_64 x86_64 x86_64 GNU/linux

我将跳转到一些说明读/写测试的图表.继承胡椒及其不平衡的读/写:

这是鲤鱼,看起来很好:

测试

以下是我正在运行的读/写测试.我分别运行这些并且它们在胡椒上看起来很棒,但是当它们一起运行时(使用&),写入性能保持稳定,而读取性能则受到很大影响.测试文件的大小是RAM的两倍(辣椒为128 GB,鲤鱼为64 GB).

# writetime dd if=/dev/zero of=/mnt/peppershare/testfile bs=65536 count=2100000 &# read time dd if=/mnt/peppershare/testfile2 of=/dev/null bs=65536 &

NFS服务器主机名是nfsc. linux客户端在子网上具有与其他任何内容分离的专用NIC(即,与主IP不同的子网).每个linux客户端都将nfs共享从服务​​器nfsc挂载到/ mnt / hostnameshare.

nfsiostat

在胡椒的模拟测试期间,有1分钟的样本:

me@pepper:~> nfsiostat 60nfsc:/vol/pg003 mounted on /mnt/peppershare:   op/s         rpc bklog1742.37            0.00read:             ops/s            kB/s           kB/op         retrans         avg RTT (ms)    avg exe (ms)                 49.750         3196.632         64.254        0 (0.0%)           9.304          26.406write:            ops/s            kB/s           kB/op         retrans         avg RTT (ms)    avg exe (ms)                1642.933        105628.395       64.293        0 (0.0%)           3.189         86559.380

我还没有老主机鲤鱼的nfsiostat,但正在努力.

的/ proc /坐骑

me@pepper:~> cat /proc/mounts | grep peppershare nfsc:/vol/pg003 /mnt/peppershare nfs rw,noatime,nodiratime,vers=3,rsize=65536,wsize=65536,namlen=255,acregmin=0,acregmax=0,acdirmin=0,acdirmax=0,hard,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=172.x.x.x,mountvers=3,mountport=4046,mountproto=tcp,local_lock=none,addr=172.x.x.x 0 0me@carp:~> cat /proc/mounts | grep carpshare nfsc:/vol/pg008 /mnt/carpshare nfs rw,v3,rsize=32768,wsize=32768,timeo=60000,retrans=3,tcp,lock,addr=nfsc 0 0

网卡设置

me@pepper:~> sudo ethtool eth3Settings for eth3:        Supported ports: [ TP ]        Supported link modes:   10baseT/Half 10baseT/Full                                100baseT/Half 100baseT/Full                                1000baseT/Half 1000baseT/Full        Supports auto-negotiation: Yes        Advertised link modes:  10baseT/Half 10baseT/Full                                100baseT/Half 100baseT/Full                                1000baseT/Half 1000baseT/Full        Advertised pause frame use: Symmetric        Advertised auto-negotiation: Yes        Speed: 1000Mb/s        Duplex: Full        Port: Twisted Pair        PHYAD: 4        Transceiver: internal        auto-negotiation: on        MDI-X: off        Supports Wake-on: g        Wake-on: g        Current message level: 0x000000ff (255)        link detected: yesme@carp:~> sudo ethtool eth1Settings for eth1:        Supported ports: [ TP ]        Supported link modes:   10baseT/Half 10baseT/Full                                100baseT/Half 100baseT/Full                                1000baseT/Full        Supports auto-negotiation: Yes        Advertised link modes:  10baseT/Half 10baseT/Full                                100baseT/Half 100baseT/Full                                1000baseT/Full        Advertised auto-negotiation: Yes        Speed: 1000Mb/s        Duplex: Full        Port: Twisted Pair        PHYAD: 1        Transceiver: internal        auto-negotiation: on        Supports Wake-on: umbg        Wake-on: g        Current message level: 0x00000007 (7)        link detected: yes

卸载设置:

me@pepper:~> sudo ethtool -k eth3Offload parameters for eth3:rx-checksumming: ontx-checksumming: onscatter-gather: ontcp-segmentation-offload: onudp-fragmentation-offload: offgeneric-segmentation-offload: ongeneric-receive-offload: onlarge-receive-offload: offme@carp:~> # sudo ethtool -k eth1Offload parameters for eth1:rx-checksumming: ontx-checksumming: onscatter-gather: ontcp segmentation offload: on

它全部位于LAN上,在nfs客户端和nfs服务器之间具有全双工的千兆交换机.另一方面,我看到cpu在胡椒上的等待时间比鲤鱼多得多,正如预期的那样,因为我怀疑它等待nfs *** 作.

我用Wireshark / Ethereal捕获了数据包,但我在那个区域并不强大,所以不确定要寻找什么.我没有在Wireshark中看到一堆以红色/黑色突出显示的数据包,所以这就是我所寻找的所有数据包:).这种糟糕的nfs性能体现在我们的Postgres环境中.

还有其他想法或疑难解答提示吗如果我能提供进一步的信息,请告诉我.

UPDATE

根据@ ewwhite的评论,我尝试了两种不同的tuned-adm配置文件,但没有变化.

在我的红色标记的右边还有两个测试.第一个是吞吐量性能,第二个是企业级存储.

nfsiostat 60企业存储配置文件

nfsc:/vol/pg003 mounted on /mnt/peppershare:   op/s         rpc bklog1758.65            0.00read:             ops/s            kB/s           kB/op         retrans         avg RTT (ms)    avg exe (ms)                 51.750         3325.140         64.254        0 (0.0%)           8.645          24.816write:            ops/s            kB/s           kB/op         retrans         avg RTT (ms)    avg exe (ms)                1655.183        106416.517       64.293        0 (0.0%)           3.141         159500.441

更新2

sysctl -a for pepper

解决方法 在fstab中添加noac nfs mount选项是银d.总吞吐量没有变化,仍然在100 MB / s左右,但我的读写现在更加均衡,我不得不想象这对Postgres和其他应用程序来说是个好兆头.

你可以看到我标记了我在测试时使用的各种“块”大小,即rsize / wsize缓冲区大小安装选项.我发现,8k尺寸的dd测试吞吐量最高,令人惊讶.

这些是我现在使用的nfs挂载选项,每个/ proc / mounts:

nfsc:/vol/pg003 /mnt/peppershare nfs rw,sync,rsize=8192,wsize=8192,noac,addr=172.x.x.x 0 0

仅供参考,noac选项man entry:

ac / noac

Selects whether the clIEnt may cache file attributes. If neither
option is specifIEd (or if ac is specifIEd),the clIEnt caches file
attributes.

To improve performance,NFS clIEnts cache file attributes. Every few
seconds,an NFS clIEnt checks the server’s version of each file’s
attributes for updates. Changes that occur on the server in those
small intervals remain undetected until the clIEnt checks the server
again. The noac option prevents clIEnts from caching file attributes
so that applications can more quickly detect file changes on the
server.

In addition to preventing the clIEnt from caching file attributes,the
noac option forces application writes to become synchronous so that
local changes to a file become visible on the server immediately. That
way,other clIEnts can quickly detect recent writes when they check
the file’s attributes.

Using the noac option provIDes greater cache coherence among NFS
clIEnts accessing the same files,but it extracts a significant
performance penalty. As such,judicIoUs use of file locking is
encouraged instead. The DATA AND MetaDATA COHERENCE section contains a
detailed discussion of these Trade-offs.

我在网络上阅读关于属性缓存的不同意见,所以我唯一的想法是它是一个必要的选项,或者与NetApp NFS服务器和/或具有更新内核的linux客户端(> 2.6.5)一起使用.我们没有在具有2.6.5内核的SLES 9上看到这个问题.

我也阅读了关于rsize / wise的不同意见,通常你采用默认值,目前我的系统是65536,但8192给了我最好的测试结果.我们也将使用postgres做一些基准测试,所以我们将看到这些各种缓冲区大小的表现.

总结

以上是内存溢出为你收集整理的linux – NFS客户端具有不平衡的读写速度全部内容,希望文章能够帮你解决linux – NFS客户端具有不平衡的读写速度所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/yw/1037298.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-24
下一篇 2022-05-24

发表评论

登录后才能评论

评论列表(0条)

保存