0

We are using a Synology Rackstation storage to store our static content which is served by a 4x Nginx backend. Now we've mounted it by nfs4 like this:

192.168.0.20:/volume1/images2        /data/images  nfs4    _netdev,rsize=32768,wsize=32768,intr,noatime           0       0

But now we're looking for a most performant way to get the static content (mostly ~500KB images). Is there any better way to do this?

Thanks!

Masterl1nk
  • 157
  • 2
  • 13
  • To clarify, are you asking for an alternative to NFS that would be faster, or the best NFS options to optimise for speed? – kapn Nov 27 '14 at 16:03
  • Is there a problem with performance right now? – ewwhite Nov 27 '14 at 16:05
  • Hi! Either an alternative to NFS or best options for NFS would be fine. About the performance right now, not really. But I want to optimize it. Thanks! – Masterl1nk Nov 27 '14 at 16:14
  • 1
    Those look like reasonable NFS defaults. Often throughput increases with NFS when you increase the MTU i.e use "jumboframes". But typically most people also try to off-load static content as much as possible making the performance of underlying storage less critical. Think setting the expires and Cache-Control headers in nginx to allow clients to cache static content longer, using open_file_cache in nginx to cache file meta data. Use varnish to cache static web content in memory, or off-load static content completely to a CDN. – HBruijn Nov 27 '14 at 16:26

1 Answers1

2

I see you've set the max values for rsize and wsize, and assuming no network or CPU bottlenecks this is likely the best you're going to get. Certainly NFS is the fastest option for a network mount.

You can test the speeds you're getting with various r and w sizes through trial and error. Take a look at http://www.tldp.org/HOWTO/NFS-HOWTO/performance.html to see some simple commands to run using dd to try out the speeds at each setting. Don't forget to umount and mount after each run to eliminate caching.

Keith

kapn
  • 231
  • 1
  • 2
  • 9