Bad NFS performance if share is loopback mounted

This document (7009907) is provided subject to the disclaimer at the end of this document.

Environment

All Linux Products
All Product versions
All Servicepacks

Situation

There is a NFS server which exports some directories. Likely the NFS Server also runs some client applications that need to access the shares that have been exported. For ease of use the exports from this NFS server are mounted by itself via NFS. A so called "loopback" NFS mount.

This looks like to work for normal conditions, but sometimes it is possible to experience bad performance during read or write to the shares. This bad performance is seen on the NFS server itself and/or on other NFS clients. The bad performance can go up to and including timeouts, locks and even deadlocks.

Generally we do NOT recommend or support this "loopback" NFS mounts.

Resolution

In Linux there is no need to loopback mount the NFS shares. Linux has the possibility to use so called "bindmounts". This bindmounts do not need to use NFS. For the NFS server this will produce less CPU usage, less memory consumption, less I/O waits, etc. etc.

To use a bindmount simply use the mount option "bind"

mount -o bind /myexport/myshare /clientmountpoint
instead of

mount -t nfs <myip>:/myexport/myshare /clientmountpoint

or

mount -t nfs 127.0.0.1:/myexport/myshare /clientmountpoint

The entry for a bindmount in /etc/fstab would look like

/myexport/myshare    /clientmountpoint    none    bind    0 0

Additional Information

The performance issue usually shows up in tough memory conditions. Think about following.

  1. NFS server needs more memory
  2. NFS server tries to flush page cache
  3. page cache tries to free memory by flushing page cache allocated by files over NFS
  4. NFS client tries to flush pages by writing back to NFS server. Go back to 1.

Disclaimer

This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.

  • Document ID:7009907
  • Creation Date: 19-Dec-2011
  • Modified Date:03-Mar-2020
    • SUSE Linux Enterprise Desktop
    • SUSE Linux Enterprise Point of Service
    • SUSE Linux Enterprise Real Time
    • SUSE Linux Enterprise Server
    • SUSE Studio Onsite
    • SUSE Lifecycle Management Server

< Back to Support Search

For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback@suse.com

SUSE Support Forums

Get your questions answered by experienced Sys Ops or interact with other SUSE community experts.

Join Our Community

Support Resources

Learn how to get the most from the technical support you receive with your SUSE Subscription, Premium Support, Academic Program, or Partner Program.


SUSE Customer Support Quick Reference Guide SUSE Technical Support Handbook Update Advisories
Support FAQ

Open an Incident

Open an incident with SUSE Technical Support, manage your subscriptions, download patches, or manage user access.

Go to Customer Center