From: Chuck Lever <chuck.lever@oracle.com>
To: Neil Brown <neilb@suse.de>
Cc: nfs@lists.sourceforge.net
Subject: Re: [PATCH 05/10] mount.nfs: Shorter timeout for TCP connects
Date: Fri, 03 Aug 2007 20:29:30 -0400 [thread overview]
Message-ID: <46B3C86A.9010804@oracle.com> (raw)
In-Reply-To: <18099.43580.95942.585732@notabene.brown>
[-- Attachment #1: Type: text/plain, Size: 2468 bytes --]
Neil Brown wrote:
> On Friday August 3, chuck.lever@oracle.com wrote:
>> The standard TCP connect timeout on Linux is 75 seconds, which can be
>> too long in some cases. The timeout itself can be altered on a system-wide
>> basis, but we'd like mount to have it's own connect timeout that's tunable,
>> and defaults to a shorter value.
>
> 75? "man 7 tcp" suggest about 180, and a simple telnet test confirmed this.
> The man page also suggests that this is due to 5 SYN packets being
> sent, but I count 6 and intervals of
>
> 3, 6, 12, 24, 48, then 96 seconds until it gives up
>
> This makes a total of 189.
The traditional TCP connect timeout is 75 seconds on *BSD, and my simple
test gave about 75 seconds on my distro. I'm not surprised that it varies.
Usually some consideration is given to the expected maximum possible
round-trip. Too short a connect timeout can prevent successful
connections to distant hosts.
> You can change The number of SYN retries with the TCP_SYNCNT socket
> option, but it is probably just as easy to use async connect and
> select as you do.
connect/select is recommended in Steven's "Unix Networking Programming,
Vol I". I think it is recommended because this is the most portable way
to time out a TCP connect.
And, unlike SYNs, "seconds" directly tunes what a user will experience.
> The sensible timeouts would seem to be (just more than)
> 3, 9, 21, 45, 93
> seconds. You have chosen 10, 20, 30
>
> Any reason for that?
I don't really think it's necessary to cleave closely to the SYN behavior.
> I'm having trouble justifying why the portmap,
> the mountd and the 'ping' calls should have different timeouts.
I did this mostly to demonstrate that it could be done. I'm not
strongly attached to the idea of having different timeouts for different
purposes.
> I would probably go for 12 seconds each. This allows 2 SYN requests,
> and 3 seconds for a response to get back. If that is too short, then
> maybe 25 seconds.
GETPORT over UDP uses 3 second retries, and times out after 20 seconds.
The 20 second RPC timeout is determined by the TIMEOUT macro, and it
might be reasonable to make the equivalent TCP timeouts roughly the same.
> Choosing timeouts is a very imprecise science, but I'd like to have at
> least some understanding of what we pick the numbers we do.
Adding some documentation in comments near the TIMEOUT definitions would
probably be useful for doing future tweaks.
[-- Attachment #2: chuck.lever.vcf --]
[-- Type: text/x-vcard, Size: 315 bytes --]
begin:vcard
fn:Chuck Lever
n:Lever;Chuck
org:Oracle Corporation;Corporate Architecture: Linux Projects Group
adr:;;1015 Granger Avenue;Ann Arbor;MI;48104;USA
email;internet:chuck dot lever at nospam oracle dot com
title:Principal Member of Staff
tel;work:+1 248 614 5091
x-mozilla-html:FALSE
version:2.1
end:vcard
[-- Attachment #3: Type: text/plain, Size: 315 bytes --]
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
[-- Attachment #4: Type: text/plain, Size: 140 bytes --]
_______________________________________________
NFS maillist - NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs
prev parent reply other threads:[~2007-08-04 0:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-03 17:23 [PATCH 05/10] mount.nfs: Shorter timeout for TCP connects Chuck Lever
2007-08-03 22:20 ` Neil Brown
2007-08-04 0:29 ` Chuck Lever [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=46B3C86A.9010804@oracle.com \
--to=chuck.lever@oracle.com \
--cc=neilb@suse.de \
--cc=nfs@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.