LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 12-02-2004, 06:20 PM   #1
BrianK
Senior Member
 
Registered: Mar 2002
Location: Los Angeles, CA
Distribution: Debian, Ubuntu
Posts: 1,334

Rep: Reputation: 51
How do I tell an NFS server to use TCP?


how do I tell my NFS server to operate over TCP instead of UDP? Does it require rebuilding NFS? Rebuilding the kernel? Is it just an option somewhere?

NFS server info:

# cat /etc/redhat-release
Red Hat Linux release 9 (Shrike)

# uname -r
2.4.20-8smp

# rpcinfo -p | grep nfs
100003 2 udp 2049 nfs
100003 3 udp 2049 nfs
 
Old 12-02-2004, 07:24 PM   #2
reelwylde
LQ Newbie
 
Registered: Apr 2003
Posts: 24

Rep: Reputation: 15
not entirely sure but Ithink it's an option in /etc/services

nfs 2049/tcp nfs # Sun NFS
nfs 2049/udp nfs # Sun NFS
 
Old 12-02-2004, 07:24 PM   #3
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
Its right there in the man page but its not really recommended or might not be supported:
Code:
tcp            Mount the NFS filesystem using the TCP protocol instead  of  the  default  UDP  protocol.   Many  NFS
               servers only support UDP.
I would imagine how udp and tcp work, udp is the better option when using NFS.
 
Old 12-02-2004, 11:05 PM   #4
BrianK
Senior Member
 
Registered: Mar 2002
Location: Los Angeles, CA
Distribution: Debian, Ubuntu
Posts: 1,334

Original Poster
Rep: Reputation: 51
Quote:
Originally posted by reelwylde
not entirely sure but Ithink it's an option in /etc/services

nfs 2049/tcp nfs # Sun NFS
nfs 2049/udp nfs # Sun NFS
hmm.. it's there for me too (both tcp and udp), but still my server is only running nfs over UDP.

Any idea why this would be?
 
Old 12-02-2004, 11:09 PM   #5
BrianK
Senior Member
 
Registered: Mar 2002
Location: Los Angeles, CA
Distribution: Debian, Ubuntu
Posts: 1,334

Original Poster
Rep: Reputation: 51
Quote:
Originally posted by trickykid
Its right there in the man page but its not really recommended or might not be supported:
Code:
tcp            Mount the NFS filesystem using the TCP protocol instead  of  the  default  UDP  protocol.   Many  NFS
               servers only support UDP.
I would imagine how udp and tcp work, udp is the better option when using NFS.
the man page is for mounting, not for serving. I know how to mount using tcp, but I'm not serving over TCP yet, so I can't mount with TCP.

UDP is sometimes a better option for NFS. It is not so good with a lossy network. With TCP, while there is a bit more back & forth, a lost packet does not force a complete retransmission - just a new packet. In that respect, it's much faster.

I am experiencing some NFS slow downs, especially on computers behind two switches. TCP sounds like it might be the solution.

Heck, lots of distros are starting to default to TCP for NFS mounts... that should tell you something, right?
 
Old 12-02-2004, 11:45 PM   #6
mritch
Member
 
Registered: Nov 2003
Location: austria
Distribution: debian
Posts: 667

Rep: Reputation: 30
trickykid is absolutely (!) right here. the client asks for tcp - the server serves tcp.

what do you think you'll find in /etc/services?

man mount. edit fstab accourdingly.

to be sure your kernel supports serving it:
$ grep NFSD_TCP config-2.4.20

sl mritch.
 
Old 12-03-2004, 10:22 AM   #7
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
Quote:
Originally posted by mritch
trickykid is absolutely (!) right here. the client asks for tcp - the server serves tcp.

what do you think you'll find in /etc/services?

man mount. edit fstab accourdingly.

to be sure your kernel supports serving it:
$ grep NFSD_TCP config-2.4.20

sl mritch.
Thanks for pointing that out mritch, like I said and like the man pages state, make sure your kernel supports serving out TCP instead of UDP, if its not working by mounting and specifying tcp, its most likely the server that doesn't support it and will default to UDP.

Read this page and you might see why UDP is by default here instead of TCP when using NFS and filesharing. http://www.informit.com/articles/article.asp?p=22081
 
Old 12-03-2004, 05:24 PM   #8
BrianK
Senior Member
 
Registered: Mar 2002
Location: Los Angeles, CA
Distribution: Debian, Ubuntu
Posts: 1,334

Original Poster
Rep: Reputation: 51
ahhh.. that's the answer I was looking for - it's in the kernel. (for the record, I did read the man pages & did try to mount via TCP, but it dodn't work - hence this question)

so..
# grep NFSD_TCP /boot/config-2.4.20-8
# CONFIG_NFSD_TCP is not set

Does this mean I need to recompile my kernel to get it running over TCP? Is there some way to do this without a kernel recompile?

Thanks.
 
  


Reply



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
NFS client = Linux, NFS server = Mac OS X Tiger --> Hell of a problem make Linux - Networking 9 03-10-2006 05:16 AM
NFS with TCP Wrappers! stakhous Linux - Software 1 02-17-2005 09:25 PM
nfs over tcp confusion linuxboy123 Linux - Software 2 08-19-2004 04:19 PM
nfs client should it use tcp or udp to nfs serve rportmapper andersonas Linux - Networking 2 06-30-2004 12:05 PM
Switching nfs from udp to tcp 850NA Linux - Networking 0 09-01-2003 10:11 PM

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

All times are GMT -5. The time now is 08:22 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