CIFS performance is slow after investigating performance issues – CIFS CONSIDERATIONS

November 23, 2010 | By | 4 Replies More

CIFS CONSIDERATIONS

File-Based Protocol:NFS, CIFS, FTP, TFTP, HTTP      Block-Based Protocol:Fibre Channel (FC), Fibre channel over Ethernet (FCoE), Internet SCSI (iSCSI)

The following filer CIFS parameters need to be changed from the filer console while in privileged mode.

Enable oplocks

Make sure that cifs.oplocks.enable is on.    Oplocks (opportunistic locks) enable a CIFS client in certain file-sharing scenarios to perform client-side caching of read-ahead, write-behind, and lock information.   A client can then read from or write to a file without regularly reminding the server that it needs access to the file in question. This improves performance by reducing network traffic. CIFS oplocks on the filer are on.  By default: You might turn CIFS oplocks off under the following circumstances otherwise, you can leave CIFS oplocks on.
1. You are using a database application whose documentation recommends that oplocks be turned off.
2. The CIFS clients are on an unreliable network.
3. You are handling critical data and you cannot afford even the slightest data loss.
sasfiler*> options cifs.oplocks.enable on
Make sure that this option is set before the clients connect to the filer.   If they are already connected, do a cifs terminate and cifs restart on the filer.
sasfiler*> options cifs.neg_buf_size 33028

cifs.oplocks_opendelta

Change the cifs.oplocks_opendelta setting. Under certain workloads setting cifs.oplocks_opendelta to 0 can improve CIFS throughput performance by 3% to 5%. Again, if setting this value to 0 results in client disconnects, reset it to 8 (the default value).  Changing the delay time for sending oplock breaks.  If a client that owns a file oplock sends a file open request, it is temporarily vulnerable to a “race condition” that can occur if the storage system requests an oplock break. To prevent this condition, the storage system delays sending an oplock break according to the delay time value (in milliseconds) specified by the cifs.oplocks.opendelta option.   By default, the default delay time is 0 milliseconds. If your storage system must support some older Microsoft Windows clients, including Microsoft you can set the delay time to another value, such as 8. This means that after the storage system receives or responds to a request to open a file, the storage system will make sure that 8 milliseconds have elapsed before sending an oplock break to that client.   options cifs.oplocks.opendelta time Here, time is the delay in milliseconds.  Setting the cifs.oplocks.opendelta option postpones the sending of oplock break requests to clients that have just opened files. You must consult technical support if you are considering setting this value higher than 35.

sasfiler*> options cifs.oplocks_opendelta 0
sasfiler*> options cifs.oplocks_opendelta 8

You might also want to increase the delay time for sending oplock breaks if you see syslog messages similar to the following: Mon Jan 21 15:18:38 PST [CIFSAdmin:warning]: oplock break timed out to station JOHN-PC for file \\FILER\share\subdir\file.txt

What is the filer’s default CIFS TCP window size?

Currently the default CIFS TCP window size on the filer is 17520 but can support a maximum TCP window size of 64240 bytes. Enter ‘options cifs.tcp_window_size’ to view the current setting.
Change the cifs.tcp_window_size setting on the filer to 64240.  Setting this option will allow more messages to be in-flight and will allow for larger data transfers.
sasfiler*> options cifs.tcp_window_size 64240
Note: The cifs.tcp_window_size and nfs.tcp.recvwindowsize options are invisible until you set them. After you set these invisible options, you can view them by entering the options cifs or the options nfs command Optimizing file and volume layout If read performance on a particular large file or LUN degrades over time, use the reallocate command to optimize its layout. If you add disks to an aggregate, use reallocate to redistribute the data equally across all of the disks in the aggregate.

Improving read-ahead performance

If the file access patterns of your clients are random (nonsequential) and the cache age is less than 3, setting minimal read-ahead to On might improve performance. By default, the NetApp system uses aggressive read-ahead, which enhances sequential access, and is more commonly used by UNIX clients and applications. Use the sysstat command to determine the cache age. Set the minra option to On for each volume to specify minimal read-ahead. By default, the option is set to Off and the NetApp system does very aggressive read-ahead.
Avoiding access time update for inodes
If your applications do not depend on having the correct access time for files, you can disable the update of access time (atime) on an inode when a file is read. Set the no_atime_update option to On for each volume to prevent updates.

For example:vol options vol2 no_atime_update on

Maintaining adequate free blocks and free inodes.  If free blocks or free inodes make up less than 10 percent of the space on any volume, the performance of writes and creates can suffer. Check free blocks and inodes by using the df command and df -i command, respectively. If over 90 percent of blocks are used, increase blocks by adding disks to the volume’s containing aggregate or by deleting snapshots. If fewer than 10 percent of inodes are free, increase inodes by deleting files or using the maxfiles command.

Tags: , , , , , , , , , , ,

Category: Home, NetApp NAS, NetApp Storage Management, Storage Management, Unified Storage

About the Author ()

Comments (4)

Trackback URL | Comments RSS Feed

  1. aspergers syndromes symptoms says:

    Nice site, nice and easy on the eyes and great content too.

  2. Anonymous says:

    excellent write up here mate you are extremely talented & you should be proud of yourself for writing such great blog posts!

  3. Nick says:

    Nice write up mate! Keep up the good work.

    Quick question, what are the expected max throughput speeds for CIFS? I’m getting an average of 80MB/s after making the above modifications.

    Thanks!

    • skynet says:

      Nick –

      On average Storage to Switch with 1GbE the througput is 110-120/mbps. What is the Etherchannel setup single/multimode, dymanic, LACP? Truncking Network ports and Storge Frontend and Backend SAS HBAs can get you better performance. What is the NetApp FAS model? What is the available free space of the aggregate. Use STATIT so get the overall statistics.

Leave a Reply