# nfs exremely slow[half solved]

## Taki

Wassup.

So I went to the wiki and and managed to setup ip masquerading. I then proceeded to sharing via nfs since I was getting totaly crapy perfomance out of samba. Here is my setup:

Server:

Celeron 2.6

512 MB Ram

Realtek RTL8201BL 10/100 Mbps Fast Ethernet PHY

```

ifconfig:

eth0      Link encap:Ethernet  HWaddr 00:14:2A:4B:79:1D  

          inet addr:192.168.0.1  Bcast:192.168.0.255  Mask:255.255.255.0

          UP BROADCAST MULTICAST  MTU:1500  Metric:1

          RX packets:898 errors:0 dropped:0 overruns:0 frame:0

          TX packets:2677 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:310814 (303.5 Kb)  TX bytes:3732594 (3.5 Mb)

          Interrupt:16 Base address:0xb000 

lo        Link encap:Local Loopback  

          inet addr:127.0.0.1  Mask:255.0.0.0

          UP LOOPBACK RUNNING  MTU:16436  Metric:1

          RX packets:52 errors:0 dropped:0 overruns:0 frame:0

          TX packets:52 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0 

          RX bytes:3984 (3.8 Kb)  TX bytes:3984 (3.8 Kb)

ppp0      Link encap:Point-to-Point Protocol  

          inet addr:10.55.55.80  P-t-P:10.64.64.64  Mask:255.255.255.255

          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1

          RX packets:1598 errors:0 dropped:0 overruns:0 frame:0

          TX packets:1491 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:3 

          RX bytes:1610905 (1.5 Mb)  TX bytes:231031 (225.6 Kb)

```

And the laptop client

Client:

PII 266MMX

64MB

ASIX AX8817x USB 2.0 Ethernet (via usb 1.1)

```

ifconfig:

eth0      Link encap:Ethernet  HWaddr 00:0C:4E:00:03:26  

          inet addr:192.168.0.2  Bcast:192.168.0.255  Mask:255.255.255.0

          UP BROADCAST MULTICAST  MTU:1500  Metric:1

          RX packets:898 errors:0 dropped:0 overruns:0 frame:0

          TX packets:2677 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:310814 (123.5 Kb)  TX bytes:3732594 (3.2 Mb)

          Interrupt:16 Base address:0xb000 

lo        Link encap:Local Loopback  

          inet addr:127.0.0.1  Mask:255.0.0.0

          UP LOOPBACK RUNNING  MTU:16436  Metric:1

          RX packets:52 errors:0 dropped:0 overruns:0 frame:0

          TX packets:52 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0 

          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

```

mounting works fine with mount 192.168.0.1:/usr/portage /usr/portage

The problem comes in with copying files.

small files (genrally less than 100k) copy fine. Big files take forever.

gkrellm2 measure 17kb and 0kb (alternates).

I know the usb 1.1 port can bottle neck it but not down to 17kb.

I tried everything on this forum, even the FORCEDETH module for Nvidia boards.

Help, please  :Crying or Very sad: 

----------

## NeddySeagoon

Taki,

Read 

```
man mount
```

the nfs part anyway.

On a client I have

```
# An NFS mount to see whats on Eccles without logging in

eccles:/home            /mnt/eccles     nfs     bg,_netdev,rsize=8192,wsize=8192
```

in my /etc/fstab for an nfs mount.

bg prevents boot hanaging if the nfs cannot be mounted.

_netdev prevnets the mount happening if the network is not up.

rsize and wsize are the block sizes to read and write, which affects the speed.

At the server end, you can use async in your /etc/exports to help speed things along but read the health warning in 

```
man exports
```

so you understand the risks.

----------

## linuxreaktor

Hi,

are you sure, you started portmap(at client and server!!) and nfsmount(on client(this starts nfsstatd))

(at server & client)

/etc/init.d/portmap start

(at client)

/etc/init.d/nfsmount start

You should consider to put portmap into default runlevel (server&client)....

If you always mount your nfs-export on your client anyway, then you should also consider putting your mount into fstab and also put nfsmount into default runlevel

greetings davidLast edited by linuxreaktor on Sun Feb 19, 2006 1:21 pm; edited 1 time in total

----------

## Taki

Ok.

I tried on the client:

```
viralbyte:/usr/portage            /usr/portage     nfs     bg,_netdev,rsize=8192,wsize=8192
```

with this on the sever:

```
taki@viralbyte ~ $ cat /etc/exports

# /etc/exports: NFS file systems being exported.  See exports(5).

# /usr/portage/distfiles 192.168.0.2/24(async,rw)

/usr/portage 192.168.0.2/24(async,rw)
```

portmap is started in the default runlevel but  i don't have nfsmount.

It mounts fine but there is no performance.  :Crying or Very sad: 

----------

## linuxreaktor

two years ago using debian fileserver i was having the same problem... solution was that portmap was not really running on the server.... But if this is not the case with you... then i've no further ideas.... I dont think that nfsmount is really important here...

----------

## Taki

Maybe I should try samba again. I really need to get this working ASAP  :Evil or Very Mad:  .

Should nfsmount be running on the client or on the server?

----------

## NeddySeagoon

Taki,

I don't have nfsmount at either end an my nfs works fine.

----------

## Taki

I did notice how ever that when I mount with nfs my ip masquerading stops working with iptables.

----------

## Taki

OK.

I fixed the ip masquirading issue. It seems to just stop working after booting.

This fixes it:

```
echo 1 > /proc/sys/net/ipv4/ip_forward
```

I got my friends windows box and I get 8MB on samba with it but I only get 17K with my linux client still. 

"I am getting pissed off mya"

-- Eric Cartman

----------

## Taki

Yippie.

I added samba rules to my iptables and re-emerged samba on my client.

I am now getting 800kb/s.

Max usb 1.1 speed is 12Mbits/s

 :Laughing:   :Laughing:   :Laughing:   :Laughing:   :Laughing:   :Laughing:   :Laughing:   :Laughing:   :Laughing: 

"Shweeet"

-- Eric Cartman

----------

## Taki

It dies sometimes but  I guess thats for another thread.

----------

