# single global nfs4 mount vs multiple specific nfs4 mounts

## DaggyStyle

Greetings,

I have a server that exports some nfsv4 mounts. there is one of them which is the common parent directory of all the specific mounts.

so I wonder, what is better performance wise, single global nfsv4 mounts and bind mounts or multiple nfsv4 mounts?

----------

## gerdesj

 *DaggyStyle wrote:*   

> Greetings,
> 
> I have a server that exports some nfsv4 mounts. there is one of them which is the common parent directory of all the specific mounts.
> 
> so I wonder, what is better performance wise, single global nfsv4 mounts and bind mounts or multiple nfsv4 mounts?

 

It's not clear whether you are re exporting a series of remote mounts and forming a daisy chain or not.  If box A mounts boxes B, C, D, E (with mounts b, c, d and e) and exports a single mount A:a like this

```

A:a/b

   /c

   /d

   /e

```

So box X sees something like /mnt/a with b, c, d, e as sub directories.  If that is the case then X will have to go through two sets of NFS server daemons, caches and all the rest. If nothing else then twice the network traffic (Case 1)

Now, if b,c,d,e are simply subfolders on A then it will have to only hit one NFS daemon. (Case 2)

Case 2 will be faster than Case 1 for obvious reasons.

If instead you are interested in whether mounting A:a (Case 2) instead of A:a/b, A:a/c, A:a/d, A:a/e (Case 3) is better then: 

Case 1 can simplify mounting lots of mounts on lots of clients

Case 2 is simple compared to 3 and extends to subdir f, g with no effort

Case 3 allows different mount options per mount

Neither 2 or 3 will show any performance difference but both will be faster than Case 1.

You pays your money ...

Cheers

Jon

----------

## DaggyStyle

Greetings, thanks for the info.

so to sum it up, if I have the following layout on the server:

```

/mnt/storage

/mnt/storage/a

/mnt/storage/b

/mnt/storage/c

/mnt/storage/d

/mnt/storage/e

```

if I export /mnt/storage in nfsv4 and on the client I'll mount it and access the sub folders by either symlinks or bind mounts (which is better performance wise it another disscussion), than I'll get the best performance I can have considering the scenario?

----------

## krinn

I think it's nearly impossible to answer your question:

- if you consider nfs will be slower to access each mount: then access one mount and its subdir, would be better.

- If you consider nfs/linux cache, then it is better to have a multi-mount, as you should have one cache per mount.

And better safe than sorry : use bind only, don't allow client to mount fsid=0

----------

## DaggyStyle

 *krinn wrote:*   

> I think it's nearly impossible to answer your question:
> 
> - if you consider nfs will be slower to access each mount: then access one mount and its subdir, would be better.
> 
> - If you consider nfs/linux cache, then it is better to have a multi-mount, as you should have one cache per mount.
> ...

 

in general, as usually there is only one client connected to the that nfs mount and it will access only one file, I don't see how multi mounts will better my situation.

----------

