NFSv4 performance woes on Debian

Over the weekend I took the opportunity to reinstall the OS on my workstation at home. Instead of choosing Debian unstable I decided to go with Debian stable + backports this time. The reason is simply to not deal with package upgrades braking the current system again. Manually fixing my local gitlab installation after a ruby upgrade annoyed the hell out of me and I simply can’t be bothered with manually going through package management and pinning down a working version of ruby and ruby-gems just to keep my current setup working.

When I started to configure system services such as ssh, nfsv4, ftpd etc. I noticed that mounting NFSv4 shares on Debian 7 (Wheezy) was quite slow (around 11 to 15 seconds). Oddly enough, once the NFS share was mounted into my local filesystem I was able to copy files as quickly as usual.

I checked dmesg and /var/log/messages after mounting the NFS share and noticed the following entries:

[17603.799651] Key type dns_resolver registered
[17603.804909] NFS: Registering the id_resolver key type
[17603.804918] Key type id_resolver registered
[17603.804918] Key type id_legacy registered
[17618.828292] RPC: AUTH_GSS upcall timed out.
[17618.828292] Please check user daemon is running.

According to the following thread, rpc-svcgssd is responsible for the nfs Kerberos authentication at the server side. I have no intention of using Kerberos at home as the time required for the set-up outweigh the benefits of single-sign-on for just a single user. I can simply set-up the same account with the same credentials on my computers. Therefore kerberos authentication should also be optional at the client side. Well it actually is, but the implementation at the moment is rather tedious. It waits for a timeout that occurs after roughly 15 seconds which introduces the delay when mounting a share.

On Redhat’s bugtracker the following entry was posted: Bug 1001934 – 15 sec timeout when mounting with nfs4:
Marcindulak provided the following workaround to fix the issue until the client is updated

blacklist the rpcsec_gss_krb5 module on the client and reboot or simply unload the kernel module

echo "blacklist rpcsec_gss_krb5" > /etc/modprobe.d/blacklist-nfs-gss-krb5.conf

or instead of rebooting you can simply use rmmod to unload the currently loaded module:
rmmod rpcsec_gss_krb5

This should eliminate the delay when mounting NFSv4 shares on Debian.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.