# NFS/Slow write [SOLVED!]

## danomac

My samba setup was not giving me very good speeds on a 100mbit LAN (4MB/sec) so I decided to try NFS.

I configured the server and clients (using hosts.allow and hosts.deny) and have successfully set up a share. Reading speeds are excellent (10-11MB/sec!) but write speeds are just horrid. I was using konqueror to transfer some files and the speed is erratic (more like completely wrong) and it stalls often. Sometimes I can wait 120-150 seconds before it will resume from a stall.

I have tried asynchronous/synchronous, v2/v3 (both client/server), changing the values of rsize/wsize and using tcp instead of udp. I've ruled out the disk subsystem as scp gives me writing speeds of 10MB/sec to the same box (yet both samba and nfs are horribly slow...) All of the NICs involved are realtek chipset based. Both PCs are running the same kernel (2.6.12-r10).

I've also read another related thread on these forums and decided to create a new one rather than resurrecting the old one. I've also spent a few hours reading tons of docs on the 'net regarding slow write speeds with no luck.

Has anyone else run into this recently? I do transfers back and forth often and was hoping to be a little closer to 100mbit than samba was...Last edited by danomac on Sun Nov 20, 2005 4:44 pm; edited 1 time in total

----------

## Kream

yes, this is a problem here as well. 

Kernel: 2.6.11-ck10

linux-headers-2.6.11-r2

nfs-utils-1.0.6-r6

----------

## Keg188

Same problem:

Kernel: 2.6.12-r9

Nic: Realtek chipset

I've looked at the forums and it seems to have affected lots of people using samba with no [resolves].

I've not done much testing and ive not tried NFS as this is only my second Linux box and i only need to be able to read media files from the box but oh my god is it slow to write (took around 16 hours to copy 150gb from my winxp machine using samba).

Could this be something to do with the Realtek chipset and direct memory access?

----------

## Keg188

Did a few more transfures last night and it seems that smaller files copy at faster speeds.

I copied over a few gigs of MP3s and it was about as fast as copying  a 700mb avi file.

Anyone got any ideas?

----------

## Redeeman

this seems to affect newer kernels.. hmm.. someone should post to lkml

----------

## konna

Maybe it`s abit old topic but problem is still up. Copying from NFS serv  with almost stable rate 4MB/s but writing starts with 10MB/s and after few sec. it slows down to ~300KB/s.

Kernel is 2.6.12-r10

Realtek popular chipe.

Really need some help or just tell me what kernel vers. don`t have that problem.

Hardware should be ok because 2 weeks ago I used debian with 2.4 kernel and speed was gr8 10/10MB/s

----------

## ocZer

I only got 1MB/s on my ABIT NF7-S2.0 with samba, and even SATA speeds, copying locally from HD only gets me 5MB/s. Strangely when I copy from DVD's or CD's it gets all the way up to 10MB/s. I've had these problems 4 ever regardless of kernel version.

----------

## Keg188

So is this problem specific to gentoo and/or the gentoo kernel or has anyone had problems with other linux builds/kernels?

My linux machine is only used as a samba server so i need to get my transfur speeds increased.

----------

## kopfsalat

I never succeeded in getting decent performance from samba even with expensive nics. So I too switched to nfs and it works very well. 

Writes saturate the 100mbit as well as reads - even with cheap realtek cards and multiple clients.

Mount options are:

rsize=8192,wsize=8192,tcp,hard,nfsvers=3,timeo=14,intr

The directory is exported on the server (debian stable on an old p2) with async.

It seems to me the only option you did not try is hard. Maybe that helps.

----------

## ocZer

Actually back when I was running Fedora Core 3 I got some decent speeds on Samba. But I cannot rememeber what I did.

----------

## konna

TBH I`m really pissed off  cause of that.  I`ve looked for solution for about 2 months and no success.  :Sad: 

And the sad fact it that I`m already looking for new distro for my server.  :Sad: 

----------

## ocZer

Anybody tried with vanilla sources?

----------

## danomac

 *kopfsalat wrote:*   

> I never succeeded in getting decent performance from samba even with expensive nics. So I too switched to nfs and it works very well. 
> 
> Writes saturate the 100mbit as well as reads - even with cheap realtek cards and multiple clients.
> 
> Mount options are:
> ...

 

I'm going to try this when I get home.

You know, I was reading this thread thinking "Gee, I have this problem" only to find out that it was myself that started it but forgot about it.   :Embarassed: 

I still have erratic write speeds... Konqueror still dies out a lot. I might look into this more this week if I have time... right now it still works but is slow as hell.

----------

## danomac

Darn, I had all those options already. I wonder what else it could be.

----------

## WildChild

I just try for the first time to setup a NFS share between two servers and I got the same problem, really fast read and slow writes. Googling, I found the solution for the problem here. The network card on the server machine was set to full duplex but the network card on the client machine was set to half duplex. Setting the network card with ethtool to full duplex solved the problem!

I hope it will help!

----------

## ocZer

Since NFS is not an option for me, I would hope that there would be a solution using samba.

----------

## danomac

I used mii-diag and ethtool but they both show 100mbit/full duplex. I had to replace my switch last week as well, and the speeds have improved a little bit, but not by much.

Next thing I will try is turning auto negotiation off, and forcing 100/FD.

----------

## danomac

Well, forcing it in 100/FD sure had some interesting results. It wouldn't even copy files.

I'll still try a couple other things, but so far, I'm totally out of options. I'm pretty close to giving up here.   :Confused: 

----------

## danomac

Solved!!!!

After umpteen tries to get it working, I finally did!!

I reset the switch, used ethtool and set the NICs to autonegotiate [+confirmed full duplex], and removed NFS client support from the server's kernel [2.6.12-r2] (NFS file system support is still there, and so is the server support.)

I did the same test:

```

danomac@okibi ~ $ ls -lh

-rw-r--r--  1 danomac users 2.0G Nov 20 03:59 file.dat

danomac@okibi ~ $ time cp file.dat /mnt/p3-500

real    3m13.200s

user    0m0.121s

sys     0m10.688s

```

2GB / 193s = 10362694.300 = 9.88MB/sec!!  :Very Happy: 

I tried it with konqueror but it isn't near as fast as the command line. Before the commandline test was 1-2MB/sec. Now I am going to try upgrading konqueror to see if perhaps there is a glitch.

----------

## vf1sveritech

I am having the same problem with my nfs and writing, and it stalling out, and when it stalls it causes reading to stall as well.  For instance playing music or movies and trying to write causes the media to stop, and the programs will just sit their until it resumes which can be very short or several minutes.  

Also, when i write to the nfs, when it first starts it'll display speeds of up to 30MB/s in konqueror, while gkrellmonitor shows nothing at all like that, its such a short burst, but it looks like its maybe close to 10MB/s.  And when I cancel the transfer, gkrellm still shows traffic outbound.

However FTP and writing works at full speed and stays constant 10MB/s AND does not disrupt streaming media.

I checked ethtools on both machines and both are full duplex and have auto-negotiation on.  Both machine's kernels have server and client support for v3 and nfs-utils installed, and portmapping on and everything.  I have reset the switch on many occasions, remounted, restarted portmapping, and nfs, and nothing seems to fix it.  Having client support on the server doesn't necessarily seem like it would be a problem, i dunno maybe, but recompiling the kernel is a whole other issue.

----------

