Nginx over NFS

Nginx over NFS

Nginx over NFS To keep Webroots in sync in clustered Webserver environments people often use Nginx over NFS as Storage Device. Because of the lack of speed, network overhead and response time of shared storage especially Nginx over NFS there could be a problem in serving dynamic content.

The solution to get rid of it I found a nice service called CacheFS which relies on fscache module and cachesfilesd daemon. With this solution it’s possible to buffer NFS mounts on your local disk.

So let’s do that!

First of all we need to install the package:

apt-get install cachefilesd

set RUN=yes in /etc/default/cachefilesd

after that you need to set the attributes: “fsc” and “user_xattr” in your /etc/fstab

UUID=123456789-xxxxxx      /     ext4    errors=remount-ro,user_xattr  0 1
192.168.1.X:/volumes/nfsdir /storage    nfs    fsc    0 0

After you rebooted your system, the service should be ready.

The Daemon will now locate the cache files to your local: /var/cache/fscache directory

Rating: 5.0/5. From 1 vote.
Please wait...
Jules

Jules

Jules is the owner and author of ISPIRE.ME. He's a Linux System Engineer, Tech fanatic and an Open Source fan.

You may also like...

1 Response

  1. Grieb62567 Grieb62567 says:

    Thanks for the in-depth examples. Very useful.

    No votes yet.
    Please wait...

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.