Showing posts with label NFS. Show all posts
Showing posts with label NFS. Show all posts

Friday, August 13, 2010

Linux - Tuning NFS for better performance

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.

Monday, April 5, 2010

EMC Celerra Character encoding for NFS

Enabling Unicode support for EMC Celerra

The Celerra Network Server supports clients in environments that use multibyte character sets. Multibyte character sets are supported by enabling universal character encoding standards (Unicode). The Celerra Network Server also supports the UTF-8 specification for character encoding, as required by NFSv4. For UTF-8 clients, file and directory names are stored as received, preserving the case of file and directory names, and no translation is required. For non UTF-8 clients, file system object names are translated to the UTF-8 specification.

Note: File systems that are not Unicode-enabled should be converted to Unicode before exporting them to NFSv4 clients. In addition, the Celerra character encoding method must be changed from the default to UTF-8.

Editing the xlt.cfg file

The xlt.cfg file defines how the Celerra Network Server should translate file and directory names for NFS and/or FTP clients into Unicode. It specifies the character mapping file(s) that should be used and allows you to configure all Data Movers to use either the same encoding or different encoding formats for different segments of your network.

NFSv4 requires UTF-8 for character encoding. By default, a Celerra system is configured to use ASCII Latin-1 character encoding. Before accessing data through NFSv4 clients, you must change the character encoding method to UTF-8 in the
/nas/site/locale/xlt.cfg file.

xlt.cfg file
The
xlt.cfg file is an ASCII text file. It contains a series of text strings, each consisting of up to six fields, that define the required client encodings to translate file/directory names into Unicode format.

The
xlt.cfg file is automatically installed in the /nas/site/locale directory during Celerra Network Server software installation. When configuring Celerra Network Server for Unicode, you issue the /nas/sbin/uc_config -update command to copy the contents of /nas/site/locale to
/.etc_common/xlt. This allows Data Movers to access xlt.cfg, if required, to complete the requested translations.

The format of text strings in xlt.cfg is as follows:
::

:::

uc_config command
uc_config
is a command for manipulating the translation files needed for Celerra Network Server’s international character support. These files are stored in a translation directory on a common file system, /.etc_common/xlt, that is available read-only to all Data Movers.

The translation directory is created when Celerra Network Server software is installed on the Control Station. If this directory is destroyed and needs to be re-created, you can do so by running the uc_config command with the -setup option.

To check for the existence of the common file system and translation subdirectory and create it if necessary, type:

Example 1:
$ /nas/sbin/
uc_config -setup

If you receive the following message, your setup is correct:
Common Unicode translation subdirectory already exists.

If you do not receive this message, contact EMC Customer Service for assistance.

Example 2:
To list the set of translation files available for conversion/update, type:

$ /nas/sbin/uc_config -list

8859-1.txt big5.txt eucjp1.txt unidata2.txt cp437.txt sjis.txt xlt.cfg

Example #3
To update all configuration files in
/.etc_common/xlt, type:

$ /nas/sbin/uc_config -update

operation in progress (not interruptible)...

done

Example #8
To confirm that the configuration of
xlt.cfg is correct for a client with an IP address of 168.159.30.77, for server_3, type:

$ /nas/sbin/uc_config -verify 168.159.30.77 -mover server_3
server_3:
168.159.30.77 is UTF-8