# NFS is driving me nuts!!!

## chidychi

hey 

I am having some trouble with nfs

It is SLOW!!

painfully slow

as in it won't exceed 192kB/s transfer from client to server.

So far in my quest to fix this I have recompiled both server and client kernels ... using only NFS vs 3 now.   Still 192kB/s

I tried Samba.  It works fine .  I get Transfer rates around 8MB/s (same client, same server)

I'm going nuts.

I can't find any info on my problem.

Any help will be greatly appreciated!!

Cheers

chi

----------

## Aszrael

Please post more info (eg your /etc/exports)

HowTos here:

http://gentoo-wiki.com/HOWTO_Share_Directories_via_NFS

http://gentoo-wiki.com/NFS

----------

## fangorn

For NFS to perform decently AFAIK you need portmap daemon running and configured properly.

----------

## chidychi

 *Aszrael wrote:*   

> Please post more info (eg your /etc/exports)
> 
> HowTos here:
> 
> http://gentoo-wiki.com/HOWTO_Share_Directories_via_NFS
> ...

 

Hey 

here is some more info

I followed the guides listed above

```
 /etc/exports

/Media/ 192.168.1.105(rw,sync)

```

```
/etc/hosts.allow

portmap: 192.168.1.105

lockd: 192.168.1.105

rquotad: 192.168.1.105

mountd: 192.168.1.105

statd: 192.168.1.105

```

```
/etc/hosts.deny

lockd:ALL

mountd:ALL

rquotad:ALL

statd:ALL

portmap:ALL

```

```
client fstab

192.168.1.106:/Media/                           /Media                          nfs              rw,sync,wsize=8192,rsize=8192,hard,intr           0 0

```

```
server

 emerge -av nfs-utils

These are the packages that I would merge, in order:

Calculating dependencies ...done!

[ebuild   R   ] net-fs/nfs-utils-1.0.7-r2  -kerberos -nonfsv4 +tcpd 0 kB 

```

 *fangorn wrote:*   

> 
> 
> For NFS to perform decently AFAIK you need portmap daemon running and configured properly.
> 
> 

 

Its running .

Where do you config it ?   :Very Happy: 

cheers

----------

## Aszrael

 *chidychi wrote:*   

> 
> 
> Where do you config it ?  
> 
> cheers

 

You can do some config in /etc/conf.d/portmap, but there is no real need for it.

You might also want to look /etc/conf.d/nfs for more options.

Aszrael

----------

## chidychi

 *Aszrael wrote:*   

>  *chidychi wrote:*   
> 
> Where do you config it ?  
> 
> cheers 
> ...

 

```
/etc/conf.d/nfs server 

# /etc/conf.d/nfs

# If you wish to set the port numbers for lockd,

# please see /etc/sysctl.conf

# Number of servers to be started up by default

RPCNFSDCOUNT=8

# Options to pass to rpc.mountd

# ex. RPCMOUNTDOPTS="-p 32767

RPCMOUNTDOPTS="-p 32767"

# Options to pass to rpc.statd

# ex. RPCSTATDOPTS="-p 32765 -o 32766"

RPCSTATDOPTS="-p 32765 -o 32766"

# Options to pass to rpc.idmapd

RPCIDMAPDOPTS=""

# Options to pass to rpc.gssd

RPCGSSDOPTS=""

# Options to pass to rpc.svcgssd

RPCSVCGSSDOPTS=""

# Timeout (in seconds) for exportfs

EXPORTFSTIMEOUT=30

RPCRQUOTADOPTS="-p 32764"

```

I have nothing in my /etc/conf.d/portmap

Any Idea's?

```
cat /usr/src/linux/.config |grep NFS

CONFIG_NFS_FS=y

CONFIG_NFS_V3=y

# CONFIG_NFS_V3_ACL is not set

# CONFIG_NFS_V4 is not set

# CONFIG_NFS_DIRECTIO is not set

CONFIG_NFSD=y

CONFIG_NFSD_V3=y

# CONFIG_NFSD_V3_ACL is not set

# CONFIG_NFSD_V4 is not set

CONFIG_NFSD_TCP=y

CONFIG_NFS_COMMON=y

```

----------

## Aszrael

your configs look good to me - just a few small things are different from my configs:

```
/etc/fstab

<IP>:/path/to/share/ /path/to/mount      nfs     noauto,user,rw,hard,intr        0 0

```

```
/etc/hosts.deny

ALL: ALL
```

```
/etc/hosts.allow

ALL: <Client-IP>
```

```
grep NFS /usr/src/linux/.config

CONFIG_NFS_FS=m

CONFIG_NFS_V3=y

# CONFIG_NFS_V3_ACL is not set

CONFIG_NFS_V4=y

CONFIG_NFS_DIRECTIO=y

CONFIG_NFSD=m

CONFIG_NFSD_V3=y

# CONFIG_NFSD_V3_ACL is not set

CONFIG_NFSD_V4=y

CONFIG_NFSD_TCP=y

CONFIG_NFS_COMMON=y

```

since I use NFS on both client and server, I started /etc/init.d/nfs on both boxes

----------

## chidychi

 *Aszrael wrote:*   

> 
> 
> since I use NFS on both client and server, I started /etc/init.d/nfs on both boxes

 

yea me too....... 

i wonder if that changes anything ?

Do you think my router could be doing any damage?

I couldn't see why (wrt54g running linux...)

----------

## chidychi

so I made some changes to reflect the files posted by Aszrael above

I aslo recompiled my kernel to have nfs vs 4 again

now ...

nothing has changed still getting 92 kB/s

but 

when starting nfs svcgssd doesn't work

```

 /etc/init.d/nfs restart

 * Stopping NFS mountd ...                                      [ ok ]

 * Stopping NFS daemon ...                                      [ ok ]

 * Stopping gssd ...                                            [ ok ]

 * Stopping svcgssd ...                                         [ !! ]

 * Stopping idmapd ...                                          [ ok ]

 * Starting idmapd ...                                          [ ok ]

 * Starting gssd ...                                            [ ok ]

 * Starting svcgssd ...                                         [ !! ]

 * Exporting NFS directories ...                                [ ok ]

 * Starting NFS daemon ...                                      [ ok ]

 * Starting NFS mountd ...                                      [ ok ]
```

----------

## Schmolch

im having the same problem, did you ever find a solution or reason why its totally fucked up?

----------

## chidychi

hey 

never found a solution 

I tried all kinds of stuff too.

I ended up just settling for samba.

sorry dude ... let me know if you figure this out.

BTW

what are you trying to connect?  

2 new computers/nics 

1 new 1 old 

2 old etc?

----------

## thepustule

Very strange.

I have been using both nfs and samba for a while, and I always find nfs to be somewhat faster than samba.  I have other problems with nfs, like locking errors and permissions issues, but never speed.

A couple of things:

1.  can you see if you get any difference by changing "sync" to "async" in your config?  Probably don't want to do this permanently unless you have a nice journalling filesystem and a UPS on your server, but it would be nice to see if it gets better when you try this.

2.  do you have another computer you can try as a different client or server to compare?  Maybe even put some other linux on this third machine, like debian or fedora, to see how it compares with gentoo.  At least this way you'll find out whether the slowness is caused by your client or by your server.

----------

