Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 at 7:28

3 Answers 3

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 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=1350,wsize=1024,tcp 0 0 

and here, for hard mounts:

rw,suid,dev,intr,exec,nouser,async,noauto,timeo=100,user,rsize=1024,wsize=1350,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

Your Answer

 
discard

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.