LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 03-15-2005, 05:45 PM   #1
drspiffy
LQ Newbie
 
Registered: Sep 2003
Location: Easton, PA, US
Distribution: Fedora Core 3
Posts: 3

Rep: Reputation: 0
NFS mount takes 6 seconds


I am running autofs on two Fedora Core 3 systems. (They were Mandrake 10.0 until recently. I was having problems with Mandrake so after a couple of years I punted.)

I have a problem which comes down to nfs mount taking too long. I never had this problem under Mandrake or any other variant but I'm disinclined to go back. Also, the only thing that changed was the distro. The firewall is unchanged (w/ fixed ports for NFS.) and the export and auto.* files are the same.

Running mount on the client under strace shows that it spends 6 seconds on the connect() to port 111 (portmapper) of the server.

Running mountd "-d all" on the server shows that the mount seems to happen in a flash (I don't know if this flash is at the beginning or the end of the 6 second wait on the client machine.)

The mount is eventually successful. It just takes way too long.
 
Old 03-15-2005, 11:18 PM   #2
clacour
Member
 
Registered: Sep 2003
Location: Dallas, Tx, USA
Distribution: Red Hat, Gentoo, Libranet
Posts: 98

Rep: Reputation: 16
From the symptoms, I strongly suspect a name resolution issue. I'm going to describe the stuff I look for on a Red Hat system. I've run RH 4.x up to 9.0, and the current RHEL stuff, but I haven't ever run Fedora. Some of these filenames may be off.

Run /sbin/ifconfig to get your IP address. (You can run all this stuff as an ordinary user, although you'll have to be root to edit any of the files.)

Check /etc/nsswitch.conf, and make sure the "hosts" line is appropriate (usually, it's "files dns").

Do a forward and backward check with "host". (I believe you can force it to use the hosts file (if present) with a "-n" option.)

Check /etc/hosts. You should have a 127.0.0.1 localhost loopback localhost.localdomain.

You should also have whatever hostname the machine has. You can either put it on the same line as the localhost stuff (that's what I normally do, especially with my laptop, since it's constantly in DHCP environments), or you can set it to your ethernet address, if that's predictable.

If you have DNS, and your machine is in it, do a forward and reverse lookup of DNS.

Oh, medium important - do this on BOTH machines - either one could be confused.

Look at your routing tables ("route -n"). (This presumes you know enough about networking to recognize weirdities, but if you don't, we'll burn that bridge when we get to it.)

Run "dmesg | grep eth", and see if you can see what speed your card(s) is running at. If that doesn't match the type of network you have, that could be the problem. (I don't think this one is very likely - that mismatch usually has little or no effect for small, infrequent network traffic (such as an NFS mount). It's on big transfers that it bites you. (Bites HARD, too!) You can also run mii-tool to get that info, if the stuff from the boot has rolled off the back end of dmesg.

Pretty much every time I've run into a mysterious network delay, where things eventually work, but take an unreasonable amount of time, it's been a name resolution issue.

Post the results, if/when you get it figured out - I'd be interested to know what it was. Feel free to post results and ask more questions here if I didn't go into enough detail. (If I went into too much, it was partly because I was also answering the next guy to come along...)

Hope this helps,

Charles Lacour
 
Old 03-15-2005, 11:34 PM   #3
geek_to_core
LQ Newbie
 
Registered: Mar 2005
Location: INDIA
Distribution: Fedora Core 3
Posts: 11

Rep: Reputation: 0
Quote:
Originally posted by clacour
Check /etc/hosts. You should have a 127.0.0.1 localhost loopback localhost.localdomain.

You should also have whatever hostname the machine has.
would a /etc/hosts entry of the (yp)server required when I am doing nfs mounting using IPs only and not names ? name resolution would be a trouble, i guess, only when i use the name as in my-ypserver.mydomain.....
 
Old 03-16-2005, 12:31 AM   #4
clacour
Member
 
Registered: Sep 2003
Location: Dallas, Tx, USA
Distribution: Red Hat, Gentoo, Libranet
Posts: 98

Rep: Reputation: 16
Quote:
...when I am doing nfs mounting using IPs only and not names ? name resolution would be a trouble, i guess, only when i use the name as in my-ypserver.mydomain.....
The correct answer to that would be "Yes". Or "No". Or "Maybe". Or "it depends".

In theory, if you're specifying everything my IP address, name resolution shouldn't enter into it. In practice, especially because of security concerns, lots of programs will do things like a reverse name lookup. If your name-resolution stuff (hosts files, dns, yp, whatever) doesn't know that box, or (worse, sometimes) has wrong info, all kinds of weird stuff can happen.

I honestly don't know how NFS handles such things - the "6 seconds" stuff caught my eye, and that's why I responded.
 
Old 03-16-2005, 11:12 AM   #5
geek_to_core
LQ Newbie
 
Registered: Mar 2005
Location: INDIA
Distribution: Fedora Core 3
Posts: 11

Rep: Reputation: 0
Thanks clacour for ur enthusiasm to help and time That was detailed stuff u said up there!
 
Old 03-16-2005, 10:34 PM   #6
drspiffy
LQ Newbie
 
Registered: Sep 2003
Location: Easton, PA, US
Distribution: Fedora Core 3
Posts: 3

Original Poster
Rep: Reputation: 0
In which I admit to being a dope

Every test of the mounting process on both sides worked and showed no problems. (Host, by the way, on my system only searches DNS in which only the servers are listed, but both are also in each others host files.)

The actual problem was that I had the following lines in my iptables files

-A INPUT -p tcp -m tcp --tcp-flags SYN,ACK,RST SYN -j SYN-FLOOD
-A INPUT -p tcp -m tcp -m state ! --tcp-flags SYN,ACK,RST SYN --state NEW -j DROP
-A SYN-FLOOD -m limit --limit 1/second --limit-burst 4 -j RETURN
-A SYN-FLOOD -j DROP

Which I guess I stuck in a couple of years ago. The idea is to inhibit a DoS attack. So these lines dropped packets that were part of the portmapper/NFS negotiation. This significantly extended the negotiation as some packets had to be resent. Actually, this problem probably also explains the problems I was having with Mandrake. Oh well, there are some things I like better about both systems. Not going back now.

Thank you for your detailed response. It helped me get to the bottom of this.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to mount a nfs mount from linux client to AIX nfs server dennyqian AIX 13 04-12-2016 12:30 AM
Mounting Reiser4 partition takes about 5 seconds DX2 Linux - General 4 05-03-2005 07:55 PM
KDE slow: takes 20 seconds to launch programs KWTm Linux - General 15 03-06-2005 01:01 AM
NFS and Samba takes forever to start. tripmix Linux - Newbie 4 12-16-2004 09:02 PM
Starting nfs takes 2 minuts frank_lis Linux - Networking 0 07-07-2004 05:25 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 05:34 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration