Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have two VPS's - One is running 2008 Server R2 and the other is a Ubuntu 12.04 installation. I am using the Windows VPS for RD sessions for Quickbooks and a couple other apps and using the Ubuntu VPS as a NFS file store as well as a OpenVPN endpoint. The problem is that NFS performance through the VPN is downright horrible and by this I mean often times it wont even connect and times out frequently.

If I set up the NFS outside the tunnel performance is okay...not great but manageable so I know its the VPN tunnel.

Are there any tweaks for openvpn or NFS I can play around with to boost performance?

share|improve this question
You are trying to make NFS do something (far) out of spec. You WebDAV idea may work, but over that story of latency WebDAV may work better, but QuickBooks is probably not the best solution. Some short of web app will probably be better – chriscowley May 9 '15 at 7:28

A few things to try:

Look at the following options in OpenVPN: fragment, mssfix, link-mtu. Basically, everything that has to do with packet size and fragmentation. Too small VPN packets may degrade performance by fragmenting NFS packets. OTOH, too large VPN packets may degrade performance because some routers don't handle them well. It's hard to draw a simple, general rule here.

Try to enable/disable compression on OpenVPN and see how that influences performance.

Make sure your VPN server uses UDP for transport, not TCP.

On the NFS client side, look at the options: retrans, rsize, wsize - or anything else related to packet size and error handling. Depending on your situation, smaller packet sizes may actually improve performance (on a LAN the opposite is typically the case).

There is no sure-fire answer to this type of problem, but the issue is likely to be in the areas indicated above.

share|improve this answer
I'm going to look at the VPN MTU size, thanks, but I have tried changing from UDP to TCP and, in my case, I obtained higher responsiveness and doubled the transfer speed (OpenVPN over slow ADSL). – Fabiano Tarlao Jun 7 '15 at 9:02

I did all the tweaks to get the optimal NFS performance over an ipsec link and "ls /mnt/remote1/etc" was still taking 12.5s. (i'm 280ms away and 13Mbps/2Mbps is my slowest link)

After some searching, I kept coming across WebDAV as an alternative. I'm using Apache with webdav and davfs2 on the client to mount the share. With this setup the ls went from 12.5 secs to 1.5 secs, and I'm getting 10Mbps download speeds. Very usable now.

If you want root access, then you need to build apache with "CFLAGS=-DBIG_SECURITY_HOLE". This is OK for me as all the users have root access, and I'm also only serving webdav via the ipsec tunnel.

share|improve this answer

I have played with NFS configuration with openvpn on ADSL connection, I have tried different NFS mount options, here you can find the complete post: NFS over OpenVPN over ADSL(or slow connection)

I quote here the interesting parts: I have read lot of posts and I have tried the reasonable subset of suggested solutions, this is the summary of the best tips:

  • use a NFS packet size smaller than littler MTU size (default is 8Kbytes, new values should be littler than 1500bytes, few guys suggest 1024bytes)
  • use NFS TCP connection type; do not use UDP on ADSL/WANs
  • use the NFS async option
  • do not set very small timeouts, left the default 60 secs (timeo=600) or.. I have tried with success 10secs (timeo=100) too
  • with the hard mount option, let's add the intr option

For linux users, here is a little fstab configuration example for soft mounts:

servername:/shared/     /mnt/foldername/  nfs     rw,suid,dev,soft,exec,nouser,async,noauto,timeo=100,user,rsize=1024,wsize=1024,tcp 0 0 

and here, for hard mounts:

rw,suid,dev,intr,exec,nouser,async,noauto,timeo=100,user,rsize=1024,wsize=1024,tcp 0 0 

NFS over vpn+adsl is still dramatically slow (at the moment I am transferring files at about 150 KB/sec, and this is far better than without the proposed changes). Please consider that my 7Mbit ADSL has a download bandwidth of 800KB/sec.

PS: I'll also check the openvpn fragmentation later, thanks for sharing. Hope that my findings are going to useful too.

PS2: Please consider that these tips has worked in my environment, I'm not sure they may work as a general rule

share|improve this answer
funny that you have different size options here that in your blog post – miguelfg Jan 20 at 12:29
Gosh! I had a txt file with tried configs, perhaps I copied the wrong rows (?).. I had a pool of "somewhat equivalent configurations"..perhaps.... thankyou pointing out, I'll check immediately and fix the post, in case. – Fabiano Tarlao Jan 25 at 19:26
Thankyou miguelfg for pointing out, I have synched rsize/wsize with blog post. The effect/difference may be negligible but I think I have updated the blog post and I forgot to update here. – Fabiano Tarlao Jan 25 at 19:36

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.