S85nfs

Synopsys


#
# Fixup NFS Performance if we are an NFS server
# Most of this comes from 
# http://nfs.sourceforge.net/nfs-howto/performance.html
# The numbers from this How-To are clearly for 2.4 kernels
# but we can improve things on 2.6 kernels in the same manner
#

Script


echo "%Post: Adjust NFS performance on Servers"
echo RPCNFSDCOUNT=32 >>/etc/sysconfig/nfs
echo >>/etc/sysconfig/nfs

cat >>/etc/sysctl.conf <<EOF
#
# NFS Performance Issues ${VERSION}
#                  
net.core.rmem_default = 262144
net.core.rmem_max = 262144
net.core.wmem_default = 262144
net.core.wmem_max = 262144
# NFS Performance Issues END

EOF

if [ "`host home.$DOMAINNAME | grep $HOSTIP | cut -d" " -f4`" == "$HOSTIP" ]; then
   # i.e. if the machine is listed as a home directory server
   # we need to create an exports file and ensure that nfs is enabled on start
   cat > /etc/exports <<EOF
# /etc/exports/file for $NODENAME.$DOMAINNAME for subnet $NETWORK
#
# Aiming to be NFSv4 complient
# Base configuration to allow export of home directories

/export         127.0.0.1/255.255.255.255(rw,fsid=0,insecure,no_subtree_check,sync)             $NETWORK/$NETMASK(rw,fsid=0,insecure,no_subtree_check,sync)
/export/home    127.0.0.1/255.255.255.255(rw,insecure,no_subtree_check,sync)			$NETWORK/$NETMASK(rw,insecure,no_subtree_check,sync)
EOF

    chkconfig --levels 345 nfs on

fi   


Examples and Testing





Marked up in XHTML - ©2005 Thoughtful Solutions Ltd.