public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jamie Lokier <jamie@shareable.org>
To: Trond Myklebust <trond.myklebust@fys.uio.no>
Cc: linux-kernel@vger.kernel.org
Subject: Re: NFS and kernel 2.6.x
Date: Sun, 18 Apr 2004 04:26:38 +0100	[thread overview]
Message-ID: <20040418032638.GA1786@mail.shareable.org> (raw)
In-Reply-To: <1082241169.3930.14.camel@lade.trondhjem.org>

Trond Myklebust wrote:
> With this patch
>         - the major timeout is of fixed length "timeo<<retrans", and the
>         clock starts at the first attempt to send the packet.
>         - If a major timeout occurs, we now reset the RTT estimator so
>         as to "slow start" when the server becomes available again.
> 
> For the moment it does use the timeo + retrans values, because the
> former is in fact wanted in order to initialize the RTT estimator.
> However, it no longer uses the count of the number of actual
> retransmissions in order to determine whether or not a major timeout
> occurred.

Ok, observations:

    - The RTT converges to 0.1s on my LAN, just as it did before the patch.
      Very sensible, and as you said the 100 microsecond problem is not
      with us these days.

    - The RTT is reset after a timeout (from 0.1-0.15s to 0.7s in my tests).
      As expected.

    - With the defaults (retrans=3, timeo=0.7s), I see:

      After disconnecting the server, the client first times out after
      about 5.5-6 seconds.  First minor timeout is 0.1.  This makes sense
      as 0.7 << 3 == 5.6.

      Subsequent timeouts take about 10.5 seconds.  This also makes sense,
      as you have set the timeout threshold at 0.7*8 == 5.6 seconds,
      and three timeouts is 0.7*(1+2+4) == 4.9 seconds, too short.
      Four timeouts is 0.7*(1+2+4+8) == 10.5 seconds.

      The old behaviour before RTT estimation would have timed out
      after 10.5 seconds, I think.

    - With retrans=5, and timeo still has the default value of 0.7s:

      After disconnecting the server, the minor timeout intervals are
      approximately:

          0.1, 0.2, 0.4, 0.8, 1.6, 3.2, 3.2, 3.2, 3.2, 3.2, 3.2 seconds.

      Are they intended to stop doubling at 3.2?  The major timeout
      thus happens after 22.3 seconds.

      Unsurprisingly, subsequent major timeouts take 44.1 seconds.

So this patch is a big improvment, and I'm going to keep using it for my home
directory with retrans=5,soft so it gets some more background testing.
(retrans=3 is too short even with the patch).

However, there are potential improvements.  One is that the 3.2 above
should continue doubling.  The other is that behaviour would be nicer
if the major timeout time was more predictable: 22.3 to 44.1 seconds
is a big range.  This is easy with the algorithm described below.

It isn't possible to have remove the variation completely.  However,
it can easily by reduced by changing the doubling strategy: keep
doubling the retransmit time, until it exceeds timeo.  When that
happens, set the retransmit time to the next greater or equal value of
timeo << N for some integer N.

For example, with RTT at 0.1s, retrans=5, timeo=0.7, these would be
the minor timeout intervals:

    0.1, 0.2, 0.4, 0.7, 1.4, 2.8, 5.6, 11.2, 22.4

leading to a total major timeout time of 44.8 seconds.

Subsequent major timeouts, with the RTT reset to 0.7s, would take 44.1
seconds: 0.7, 1.4, 2.8, 5.6, 11.2, 22.4.

If the RTT estimator is larger than timeo to start with, the first
retransmit will timeout after RTT, but subsequent ones will be a value
of timeo << N.  E.g. if RTT was 2s, this would be the minor timeout
sequence: 2.0, 2.8, 5.6, 11.2, 22.4.

The algorithm for deciding when a major timeout occurs is different
too.  Instead of keeping track of the total time since the very first
transmission, you simply deem the major timeout to occur after the
minor timeout of timeo << retrans occurs.  I.e. in these examples, the
22.4s minor timeout is always the final one.

This reduces the possible variation, with these parameters, to the
range 44.1 to 45.325 seconds: much more consistent than 22.05 to 44.1
seconds.

As well as giving more consistent results, this might even be simpler
than the algorithm in your patch, because there is no need to remember
the total time since the first transmission.

-- Jamie

  reply	other threads:[~2004-04-18  3:26 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-16  1:14 NFS and kernel 2.6.x Charles Shannon Hendrix
2004-04-16  1:31 ` Trond Myklebust
2004-04-16  1:53   ` Andrew Morton
2004-04-16  2:54     ` Trond Myklebust
2004-04-16  4:59       ` Phil Oester
2004-04-16  5:29         ` Trond Myklebust
2004-04-16  7:13           ` Paul Wagland
2004-04-16 14:44           ` Marcelo Tosatti
2004-04-16 14:46             ` Marcelo Tosatti
2004-04-16 15:50             ` Trond Myklebust
2004-04-16 15:55             ` Dave Gilbert (Home)
2004-04-16 16:13               ` Trond Myklebust
2004-04-16 19:07                 ` Daniel Egger
2004-04-17  4:56                   ` Chris Friesen
2004-04-17  9:56                     ` Daniel Egger
2004-04-17  5:24                   ` Trond Myklebust
2004-04-17 14:15                     ` Daniel Egger
2004-04-16 19:11                 ` Charles Shannon Hendrix
2004-04-17 16:44           ` Matthias Urlichs
2004-04-17 18:15             ` Trond Myklebust
2004-04-17 18:32               ` Marc Singer
2004-04-17 18:58                 ` Trond Myklebust
2004-04-17 19:01                   ` Marc Singer
2004-04-17 19:09                     ` Trond Myklebust
2004-04-17 19:19                       ` Russell King
2004-04-18  2:51                         ` Trond Myklebust
2004-04-19 16:39                           ` Trond Myklebust
2004-04-19 21:10                             ` Trond Myklebust
2004-04-17 22:22                   ` Marc Singer
2004-04-18  0:57                     ` Trond Myklebust
2004-04-18  5:01                       ` Marc Singer
2004-04-18  6:36                         ` Chris Friesen
2004-04-18  7:56                           ` Russell King
2004-04-18 17:31                             ` Marc Singer
2004-04-17 19:01                 ` Daniel Egger
2004-04-17 20:22                   ` Marc Singer
2004-04-18 11:14                     ` Daniel Egger
2004-04-19  9:06             ` Helge Hafting
2004-04-16  9:03     ` Jamie Lokier
2004-04-16 15:55       ` Trond Myklebust
2004-04-16 18:48         ` Jamie Lokier
2004-04-16 19:06           ` Trond Myklebust
2004-04-16 19:39             ` Jamie Lokier
2004-04-17 22:32               ` Trond Myklebust
2004-04-18  3:26                 ` Jamie Lokier [this message]
2004-04-18  7:03                   ` Trond Myklebust
2004-04-18 23:22                     ` Jamie Lokier
2004-04-19 15:38                       ` Trond Myklebust
2004-04-19 16:19                         ` Trond Myklebust
2004-04-20  0:09                         ` Jamie Lokier
     [not found]   ` <20040416190126.GB408@widomaker.com>
     [not found]     ` <1082144608.2581.156.camel@lade.trondhjem.org>
     [not found]       ` <20040417000353.GA3750@widomaker.com>
2004-04-17  5:28         ` Trond Myklebust
2004-04-17 17:55           ` Charles Shannon Hendrix
2004-04-17 18:55             ` Trond Myklebust
     [not found] <1Lql8-6O3-1@gated-at.bofh.it>
     [not found] ` <1LquO-6TK-5@gated-at.bofh.it>
     [not found]   ` <1LqOg-76p-19@gated-at.bofh.it>
     [not found]     ` <1LrKo-7Sn-21@gated-at.bofh.it>
     [not found]       ` <1LtM3-12d-5@gated-at.bofh.it>
     [not found]         ` <1Luf2-1kK-1@gated-at.bofh.it>
     [not found]           ` <1LDBL-uY-3@gated-at.bofh.it>
2004-04-16 20:31             ` Andi Kleen

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=20040418032638.GA1786@mail.shareable.org \
    --to=jamie@shareable.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=trond.myklebust@fys.uio.no \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox