免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1930 | 回复: 0
打印 上一主题 下一主题

Items about NFS tuning [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-03-26 17:33 |只看该作者 |倒序浏览
I am reading the pdf file named: "NFS Server Performance and Tuning Guide for Sun Hardware".
I intend to share some selected items from it.
There are too common versions when the book is published: NFS version 2, NFS version 3; but there is a updated version 4 available in Solaris 10 currently, though it is not covered in that book.

check performance:

1). Commands:
1. nfsstat -s               //run in nfs server
2. nfsstat -c               //run in nfs client
3. nfsstat -m               //run in nfs client

Samples:
[nfsserver]# nfsstat -s
Server rpc:
Connection oriented:
calls        badcalls     nullrecv     badlen       xdrcall      dupchecks
35322955     0            0            0            0            3358371
dupreqs
0
Connectionless:
calls        badcalls     nullrecv     badlen       xdrcall      dupchecks
0            0            0            0            0            0
dupreqs
0

Server nfs:
calls        badcalls
33774337     0
Version 3: (32593070 calls)
null         getattr
      setattr      lookup       access       readlink
63 0%        23891529 73% 264610 0%    3388297 10%  780455 2%    9549 0%
read         write        create       mkdir        symlink      mknod
591497 1%    2199452 6%   300102 0%    38958 0%     7 0%         0 0%
remove       rmdir        rename       link         readdir      readdirplus
291648 0%    36797 0%     11190 0%     18 0%        33158 0%     215560 0%
fsstat       fsinfo       pathconf     commit
3485 0%      62 0%        99 0%        536534 1%
Server nfs_acl:
Version 2: (0 calls)
null         getacl       setacl       getattr      access
0 0%         0 0%         0 0%         0 0%         0 0%
Version 3: (144642 calls)
null         getacl       setacl
0 0%         144642 100%  0 0%

comments:If getattr is larger than 40%, you may need modify the system parameter:ncsize, it is used for (name cache).


[email=root@nfsclient]root@nfsclient[/email]
# nfsstat -m
/opt/home from nfsserver:/opt/home
Flags:         vers=3,proto=tcp,sec=sys,soft,intr,link,symlink,acl,rsize=32768,wsize=32768,retrans=5,timeo=600
Attr cache:    acregmin=3,acregmax=60,acdirmin=30,acdirmax=60

so you can see the nfs options: vers, proto,sec,rsize,wsize,retrans,timeo.
I have known that rsize and wsize is the cache size of read and write.

2). Diag
1. network
netstat -i
2)disk driver
iostat -X
3)CPU
mpstat 2 3
4)Memory
vmstat 2 3
5)swap space
swap -s
6)Number of NFS threads in /etc/init.d/nfs.server

3)nfs settings file
/etc/default/nfs

4). Cache File System
With the cache file system in NFS client, files are send to the momory of client and manipulate directly. Data is writen back to the server.
# device device mount FS fsck mount mount
# to mount to fsck point type pass at boot options
server:/usr/dist cache /usr/dist cachefs 3 yes
ro,backfstype=nfs,cachedir=/cache


To monitor it, /usr/bin/cachefsstat -z [path]

5). Tuning Parameter
1. NFS threads
/etc/init.d/nfs.server lines:
/usr/lib/nfs/nfsd -a 64
64 means to make 64 threads.

The pricipal for nfs threads like below:
a. 2 threads for each active client
b. 16 or 32 threads for one CPU
c. 16 threads for each 10 Mbits of network capacity.

2. system parameter: maxusers
Because the following parameter is based maxusers:
Inode cache:ufs_ninode=17*maxusers+90
Name Cache:ncsize=17*maxusers+90

3.Adjust Buffer Cache(bufhwm)


-------------------To be continued.







本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/458/showart_265217.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP