Tagged with: NFS rsize wsize NFS Settings NFS Optimized
Basic Environment Information:
[Email protected]/]# cat/etc/redhat-release CentOS release 6.7 (Final) [[email protected]/]# uname-r2.6.32-573.el6.x86 _64[[email protected]/]#
The default Mount properties are:
[[Email protected] /]# showmount -e nfs01export list for nfs01:/data 172.16.1.0/24[[email protected] /]# mount -t nfs nfs01:/data /mnt[[ email protected] /]# df -hfilesystem size used avail use% mounted on/dev/sda3 6.9g 1.8G 4.7G 28% /tmpfs 238M 4.0K 238M 1% /dev/shm/dev/sda1 190M 36M 145M 20% /bootnfs01:/data 6.9g 1.7g 4.8g 27% /mnt[[email protected] /]# grep mnt /proc/mountsnfs01:/data/ /mnt nfs4 rw,sync,relatime,vers=4, Rsize=65536,wsize=65536,namleN=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=172.16.1.61,minorversion=0,local_lock=none, addr=172.16.1.31 0 0[[email protected] /]# # #tcp协议默认的rszie和wsize为65536
Modify Rsize and Wsize:
[Email protected] nfsd]# umount/mnt[[email protected] nfsd]# mount-t nfs-o rsize=131072,wsize=131072 nfs01:/data/mnt [Email protected] nfsd]# grep mnt/proc/mountsnfs01:/data//mnt nfs4 rw,relatime,vers=4,rsize=65536,wsize=65536, namlen=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=172.16.1.61,minorversion=0,local_lock= none,addr=172.16.1.31 0 0[[email protected] nfsd]# # #可以看到修改后并没有生效
Use the tcpdump command to grab the package viewing process:
[Email protected] ~]# tcpdump-nn-i eth1-w wireshark.cap-s 0
Using Wireshark to analyze packages
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/7F/8F/wKioL1ci4mrwA_umAAEXk_qKlgQ088.png "title=" QQ picture 20160429122100.png "alt=" Wkiol1ci4mrwa_umaaexk_qklgq088.png "/>
Rsize and wsize are found to be negotiated with the server and answered by the server (NFS V4 compound reply package).
Check the relevant information: nfs server considers memory consumption when deciding the default maximum read-write block size, with each NFS kernel thread using up to 1/4096 of the physical memory size, uses the maximum 1MB read-write block size for machines that have more than 4GB of physical memory. Document this size for/proc/fs/nfsd/max_block_size.
To view the size of the file on the server side:
[Email protected] ~]# cat/proc/fs/nfsd/max_block_size 65536[[email protected] ~]#
Find out where the problem is! And then I made the following changes.
1. Stop NFS Service
[[email protected] ~]# /etc/init.d/nfs stopshutting down nfs daemon: [ ok ]Shutting down NFS mountd: [ ok ]shutting down nfs quotas: [ ok ]shutting down nfs services: [ OK ]Shutting down RPC idmapd: [ ok ][[email protected ] ~]#
2, modify the Max_block_size
[Email protected] ~]# echo 1048576 >/proc/fs/nfsd/max_block_size [[email protected] ~]# Cat/proc/fs/nfsd/max_block_ Size1048576[[email protected] ~]# # #直接改为最大1M.
3. Start the NFS service
[[email protected] ~]# /etc/init.d/nfs startstarting nfs services: [ OK ]Starting NFS quotas: [ ok ]starting NFS mountd: [ OK ]Starting NFS daemon: [ OK ]Starting RPC idmapd: [ ok ][[email protected] ~]#
4. Mount the Client
[[email protected] nfsd]# mount-t nfs-o rsize=131072,wsize=131072 nfs01:/data/mnt[[email protected] nfsd]# grep MNT/PR oc/mountsnfs01:/data//mnt nfs4 rw,relatime,vers=4,rsize=131072,wsize=131072,namlen=255,hard,proto=tcp,port=0, timeo=600,retrans=2,sec=sys,clientaddr=172.16.1.61,minorversion=0,local_lock=none,addr=172.16.1.31 0 0[[email Protected] nfsd]# # #修改成功!
Problem Solving!
This article is from the "Your Night" blog, be sure to keep this source http://lixin15.blog.51cto.com/3845983/1768956
Resolving NFS Client Configuration Rszie and Wsize does not take effect