1:客户端连接数优化
echo "options sunrpc tcp_slot_table_entries=128" >> /etc/modprobe.d/sunrpc.conf
echo "options sunrpc tcp_max_slot_table_entries=128" >> /etc/modprobe.d/sunrpc.conf
sysctl -w sunrpc.tcp_slot_table_entries=128
# 如果返回值为128,则说明修改成功。
# 查看具体是否成功
cat /proc/sys/sunrpc/tcp_slot_table_entries
2:挂载
mount -t nfs -o vers=4,nolock,proto=tcp,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport 10.0.0.10:/data /nfs
[root@virtual_host ~]# df -Th | grep nfs
10.0.0.10:/data nfs4 17G 2.0G 16G 12% /nfs
3:服务端配置
[root@virtual_host ~]# cat /etc/sysconfig/nfs | grep -Ev "^(#|$)"
LOCKD_TCPPORT=32803
LOCKD_UDPPORT=32769
RPCNFSDARGS=""
RQUOTAD_PORT=875
RPCMOUNTDOPTS=""
MOUNTD_PORT=892
STATDARG=""
STATD_PORT=662
STATD_OUTGOING_PORT=2020
RPCNFSDARGS="-N 4"
SMNOTIFYARGS=""
RPCIDMAPDARGS=""
RPCGSSDARGS=""
GSS_USE_PROXY="yes"
BLKMAPDARGS=""
[root@virtual_host ~]# cat /etc/exports
/data *(insecure,rw,sync,no_root_squash,no_subtree_check)
[root@virtual_host ~]# cat /etc/nfsmount.conf | grep Nfs
Nfsvers=4