LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   NFS a little slow to mount (https://www.linuxquestions.org/questions/linux-newbie-8/nfs-a-little-slow-to-mount-631884/)

greengrocer 03-31-2008 06:49 AM

NFS a little slow to mount
 
Hello everyone,

I have a question about NFS running on my two Ubuntu systems.

When I mount an NFS export from the NFS server, initially the mount takes 30 seconds before it is mounted.

Of course once mounted, things are fine, I can copy large files no problem and the speeds are acceptable.

My question is, why does the mount itself take so long to process?

The export on the NFS server looks something like this:

/media/hdc1 192.168.0.1(rw,no_root_squash,async)

alan_ri 03-31-2008 10:08 AM

It depends how large is NFS export and how fast is connection.Maybe mounting automaticly on boot would get it faster.

AwesomeMachine 03-31-2008 10:19 AM

nfs is tricky. Sometimes it mounts right away, and other times it waits.

Hangdog42 03-31-2008 11:26 AM

Do you have portmap running on both the NFS client machine and the server?

greengrocer 03-31-2008 07:26 PM

Quote:

It depends how large is NFS export and how fast is connection.Maybe mounting automaticly on boot would get it faster.
The NFS Export is about 17Gb of data. The connection is over gigabit ethernet LAN.

I have not tried putting an entry in the fstab of the client to auto-mount on boot.

Quote:

Do you have portmap running on both the NFS client machine and the server?
Not sure.

sundialsvcs 03-31-2008 09:52 PM

The only way to definitively resolve such problems is to watch the connection with a packet-sniffer like ethereal. But if you're getting a 30-second (or similar) delay, there's a very good chance that it's a timeout.

Here's one thing to check: what does /etc/resolv.conf say?

Let's say that it contains something like this:
Code:

search foobar.myhost.net
nameserver 111.112.113.114
nameserver 221.222.223.224

Okay, then, try this command-line command: dig@111.112.113.114 your_nfs_host

Does it reply instantly, or does it wait ... say ... 30 seconds?

If so, your computer might be posting a request to the first nameserver, then waiting a long time before trying the second one. A classic "timeout."

You're looking for something like that. Whenever a computer waits, not only for a "human-noticeable" amount of time but a "human-annoying" amount of time, it is probably ... as the thespians among us would instantly grok ... "waiting for Godot."

greengrocer 04-01-2008 05:59 AM

dig@<ip address of router> results in bash command not found.

But I can give some ping statistics:

64 bytes from 192.168.x.x: icmp_seq=1 ttl=255 time=0.763 ms
64 bytes from 192.168.x.x: icmp_seq=2 ttl=255 time=0.738 ms
64 bytes from 192.168.x.x: icmp_seq=3 ttl=255 time=0.768 ms
64 bytes from 192.168.x.x: icmp_seq=4 ttl=255 time=0.929 ms
64 bytes from 192.168.x.x: icmp_seq=5 ttl=255 time=4.10 ms
64 bytes from 192.168.x.x: icmp_seq=6 ttl=255 time=6.77 ms
64 bytes from 192.168.x.x: icmp_seq=7 ttl=255 time=0.740 ms
64 bytes from 192.168.x.x: icmp_seq=8 ttl=255 time=0.734 ms
64 bytes from 192.168.x.x: icmp_seq=9 ttl=255 time=0.735 ms
64 bytes from 192.168.x.x: icmp_seq=10 ttl=255 time=0.732 ms
64 bytes from 192.168.x.x: icmp_seq=11 ttl=255 time=0.730 ms
64 bytes from 192.168.x.x: icmp_seq=12 ttl=255 time=0.740 ms
64 bytes from 192.168.x.x: icmp_seq=13 ttl=255 time=6.02 ms
64 bytes from 192.168.x.x: icmp_seq=14 ttl=255 time=1.95 ms
64 bytes from 192.168.x.x: icmp_seq=15 ttl=255 time=0.729 ms

Which look quick enough to me.

And as I said, once the nfs resource is mounted on the client, then file transfers are quick. I can stream video across the network smoothly etc.

greengrocer 04-01-2008 06:12 AM

Quote:

Do you have portmap running on both the NFS client machine and the server?
Hey thanks for the suggestion.

I installed portmap on the client

Code:

sudo apt-get install portmap
The portmap daemon was started automatically and i did:

Code:

mount 192.168.x.x:/media/foo /media/foo
and the NFS export was mounted within about 2 seconds. A rather large improvement :)

Many thanks to you Hangdog42

Hangdog42 04-01-2008 07:12 AM

I've learned that one the hard way myself. Glad that was all it was.


All times are GMT -5. The time now is 12:19 PM.