e1e0.net

sources for e1e0 website
git clone https://git.e1e0.net/e1e0.net.git
Log | Files | Refs

nfs-performance-improvements-openbsd.md (1674B)


      1 Title: Performance improvements on NFS mounts on OpenBSD
      2 Author: paco
      3 Date: 2018-11-18
      4 Type: article
      5 
      6 Those are simple notes on how to increase performance (read basically)
      7 on my OpenBSD desktop again my NAS at home.
      8 
      9 The NAS exports a set of folders via various protocols. AFP for the
     10 Macs, NFS for OpenBSD and maybe Linux and Samba for everything else
     11 (basically one Ubuntu I use as media center).
     12 
     13 It runs FreeBSD, and the performance is generally good on all protocols,
     14 limited more or less by the speed of the link 1Gbps but OpenBSD was
     15 reporting some low values, in the order of 390Mbps read and 60 Mbps
     16 write.
     17 
     18 A quick look at the OpenBSD list archives gives me a nice [thread][1] that
     19 explains a lot.
     20 
     21 After some playing around, I applied the following options to the NFS
     22 mount points:
     23 
     24     -T/-U     To force TCP or UDP respectively, see below
     25     -3        To force NFSv3 (this is unnecessary as is the default)
     26     -a 4      readahead value set to the max. See mount_nfs(8)
     27     -r 32768  readsize. Again see mount_nfs(8)
     28     -w 32768  writesize. same thing.
     29     noatime   I set this up always on network resources.
     30 
     31 Oddly enough, I get more stable results (specially on writes) using TCP
     32 instead of UDP ...
     33 
     34 On TCP that read speed is almost saturating the link, ad 890Mbps and
     35 write speed is way better (enough for me anyway) at 410Mbps
     36 
     37 On UDP read speed is even better around 905Mbps but write speed is poor
     38 and inconsistent at about 128Mbps
     39 
     40 So in the end I end up using TCP. Maybe I'll take a closer look in the
     41 future to see if I can improve write a little bit, but it's OK for me at
     42 this stage.
     43 
     44 [1]: https://marc.info/?l=openbsd-misc&m=146130062830832&w=2