# Slow NFS with 2.6 kernel

## tmo

Here's my setup

Server:

- development-sources-2.6.2

- 8139TOO 100 Mb/s card

Client:

- mm-sources-2.6.2-r1

- 8139TOO 100 Mb/s card

eth-tool reports 100 Mb full duplex for both cards.

mount options: noatime,intr,bg,tcp,mountvers=3,nfsvers=3

From client to server upload speed is 70 Mb/s but from server to client speed is only 40 Mb/s. I have tried lots of different mount options but can't get nfs any faster. rsize=8192 and wsize=8192 don't help. With 2.4 kernel speed was 85 Mb/s. emerge sync on the server makes nfs mounts very slow even when it is niced to 19. Any ideas?

----------

## Cosmin

Emerge and start portmap. Be sure to read the manual for it and create the configuration file. Got me crazy once, until I found the reason! After that I was just mad!

----------

## smart

Did it help ?  :Smile: 

You got me hooked... how do you get  70MB/s through NFS without portmap running ? In a standard installation like gentoo is running it...

----------

## Cosmin

There is no "standard installation" with Gentoo... Did you have portmap added to your default runlevel in the first place, or it's you who added portmap after?

I didn't measured the speed, but it really took a long time to mount a NFS share.

Portmap is used just to help RPC locate the NFS server, I think, so once the connection is established, you can communicate (more/less succesfully) with your server. If you have a linux box handy, you can check out and tell me I'm wrong. I told you what I have done to solve MY problem. Yours could be different though...

[EDIT] I could run NFS without portmap running, but the mount was very slow.

----------

## smart

There is a standard installation of NFS in gentoo. Which is standard NFS. And standard NFS as you said uses portmap to figure out the ports  :Smile: 

Furthermore

/etc/init.d/nfs

contains

depend() {

need net portmap

after quota

}

so you probably don't need to start portmap yourself.

Portmap is not related to the transfer speed at all and thus not related to this thread.

Two things would be interesting from me to learn from tmo

- if you exchange the kernel with the other of (pre-)emptible compared to what you run right now, does performance change ?

- i experienced problems when running a serialport transfer resulting in CRC errors. It seemed to me that the serial port handling collided with disk I/O. If you had the time, i would appreciate if you could try e.g. a somewhat bigger file transfer via zmodem for example and watch how it reacts when disk I/O kicks in. If you've got the same results, then i guess that this would be a hint that there is stilll something flaky in the new kernels.

----------

## tmo

Thanks for your replies. I have portmap running on both computers. The server has nfs in the default runlevel and the client has nfsmount in the default runlevel. Those scripts depend on portmap.

My kernels have CONFIG_PREEMPT=y. I try with pre-empt disabled and let you know if it helps.

----------

## tmo

Disabling preempt didn't affect the performance. I noticed loadavg on the server was about 5 when copying big file to the client. I changed RPCNFSDCOUNT (/etc/conf.d/nfs) to 1 . That change increased speed to 65 Mb/s and loadavg dropped to 1 but made my desktop unusable while copying.

----------

## ssozonoff

Hi tmo,

I am having a similar experience, see here

https://forums.gentoo.org/viewtopic.php?t=144974

Any solution?

Thanks,

Serge

----------

## b0fh

I'm also getting poor nfs-results (also described here: https://forums.gentoo.org/viewtopic.php?t=172267& ). Did you find any solution you might want to share?

As you can also read here ( https://forums.gentoo.org/viewtopic.php?t=167804& ), it might be a gentoo-specific problem, but why?

----------

## ShiVa

i had arround 330kb/s for both, upload and download.

so it set the export option to async in /etc/exports on the server (had it on sync) and removed sync for the nfs share in my /etc/fstab (dunno why i had it there).

now it's fast again!

hope this helps anybody as i think it might no be related to the problem described above ...   :Smile: 

----------

## irony

How do you test the speed of an nfs mount?

----------

## ShiVa

 *irony wrote:*   

> How do you test the speed of an nfs mount?

 

take a (100mb) file and copy it between local drive an share using mc for example. it shows you the current aand theoverall average speed.

----------

## ticho

 *ShiVa wrote:*   

> i had arround 330kb/s for both, upload and download.
> 
> so it set the export option to async in /etc/exports on the server (had it on sync) and removed sync for the nfs share in my /etc/fstab (dunno why i had it there).

 

I too have a problem with slow upload to a mounted NFS share. Download works OK, I get full 100Mbit/s (via ethernet), but on upload, I only get ~30Mbit/s.

The "async" option does help a bit - it makes the upload go at 40-50kbit/s, but then all applications' progress bars are screwed, because of the asynchronous transfer - apps report higher transfer speed than it really is, and then progressbar stops at 100%, waiting for the real transfer to finish.

I have tried setting both "rsize" and "wsize" to 8192, but this did not have any effect.

I'm hoping someone will eventually figure out what the problem is.

----------

