星期五, 11月 25, 2011

Tuning NFS for better performance

最近客戶用的某國產NAS有效能疑慮...所以臨時找了這邊來調整看看~後來發現不是這問題,是file system  沒格式化成ext3 的格式


http://www.techrepublic.com/blog/opensource/tuning-nfs-for-better-performance/64

Tuning NFS for better performance

By Vincent Danen
June 11, 2007, 10:12 AM PDT
The Network File System (NFS) is still very popular on Linux systems, but it can use some help to increase performance by tweaking the relatively conservative defaults that most Linux distributions ship with. This can be done by tweaking both NFS servers and clients.
On the server side, you must ensure that there are enough NFS kernel threads to handle the number of connections by the clients. You can determine whether or not the default is sufficient by looking at RPC statistics using nfsstat on the NFS client:
# nfsstat -rc
Client rpc stats:
calls      retrans    authrefrsh
3409166    330        0
Here you can see that the retrans value is quite high, meaning that retransmissions were often necessary since the last reboot. This is a clear indication that the number of available NFS kernel threads on the server is insufficient to handle the requests from this client. The default number of threads for rpc.nfsd to start is typically eight threads.
To tell rpc.nfsd to use more kernel threads, the number of threads must be passed as an argument to it. Typically, most distributions will have a file such as /etc/sysconfig/nfs to configure this; on a Mandriva Linux system, the configuration item RPCNFSDCOUNT in /etc/sysconfig/nfs is used to determine the number of kernel threads to pass to rpc.nfsd. Increase this number — perhaps to 16 — on a moderately busy server, or increase up to 32 or 64 on a more heavily used system. Re-evaluate using nfsstat to determine whether or not the number of kernel threads is sufficient; if the retrans setting is 0 then it is enough; but, if the client still needs to retransmit, increase the number of threads further.
On the client side of things, remote NFS mounts should be mounted with the following options:
rsize=32768,wsize=32768,intr,noatime
By default, most clients will mount remote NFS file systems with an 8-KB read/write block size; the above will increase that to a 32-KB read/write block size. It will also ensure that NFS operations can be interrupted if there is a hang and will also ensure that the atime won't be constantly updated on files accessed on remote NFS file systems.
If NFS file systems are mounted via /etc/fstab, make the changes there; otherwise, you will need to make them to any configuration files belonging to your chosen automounter. In the case of amd, the /etc/amd.net file would look like:
/defaults fs:=${autodir}/${rhost}/root/${rfs};opts:=nosuid,nodev,rsize=32768,wsize=32768,intr,noatime
*       rhost:=${key};type:=host;rfs:=/
By tweaking the defaults of NFS servers and clients, you can make using NFS faster and more responsive, particularly if you make heavy use of NFS file systems.
Delivered each Tuesday, TechRepublic's free Linux NetNote provides tips, articles, and other resources to help you hone your Linux skills. Automatically sign up today!

沒有留言:

LinkWithin-相關文件

Related Posts Plugin for WordPress, Blogger...