9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: erik quanstrom <quanstro@quanstro.net>
To: 9fans@9fans.net
Subject: Re: [9fans] fossil+venti performance question
Date: Wed,  6 May 2015 20:35:28 -0700	[thread overview]
Message-ID: <595e28c2c25b6d648085e5d51c5d51f3@lilly.quanstro.net> (raw)
In-Reply-To: <CAOw7k5j2q963Y_DyObQNVUHmVkrP5Z5UuRtO-9LsWgVtRMk8iQ@mail.gmail.com>

On Wed May  6 15:30:24 PDT 2015, charles.forsyth@gmail.com wrote:

> On 6 May 2015 at 22:28, David du Colombier <0intro@gmail.com> wrote:
> 
> > Since the problem only happen when Fossil or vacfs are running
> > on the same machine as Venti, I suppose this is somewhat related
> > to how TCP behaves with the loopback.
> >
> 
> Interesting. That would explain the clock-like delays.
> Possibly it's nearly zero RTT in initial exchanges and then when venti has
> to do some work,
> things time out. You'd think it would only lead to needless retransmissions
> not increased latency
> but perhaps some calculation doesn't work properly with tiny values,
> causing one side to back off
> incorrectly.

i don't think that's possible.

NOW is defined as MACHP(0)->ticks, so this is a pretty course timer
that can't go backwards on intel processors.  this limits the timer's resolution to HZ,
which on 9atom is 1000, and 100 on pretty much anything else.  further limiting the
resolution is the tcp retransmit timers which according to presotto are
	/* bounded twixt 0.3 and 64 seconds */
so i really doubt the retransmit timers are resending anything.  if someone
has a system that isn't working right, please post /net/tcp/<connectionno>/^(local remote status)
i'd like to have a look.

quoting steve stallion ,,,

> > Definitely interesting, and explains why I've never seen the regression (I
> > switched to a dedicated venti server a couple of years ago). Were these the
> > changes that erik submitted? ISTR him working on reno bits somewhere around
> > there...
>
> I don't think so. Someone else submitted a different set of tcp changes
> independently much earlier.

just for the record, the earlier changes were an incorrect partial implementation of
reno.  i implemented newreno from the specs and added corrected window scaling
and removed the problem of window slamming.  we spent a month going over cases
from 50µs to 100ms rtt latency and showed that we got near the theoretical max for
all those cases.  (big thanks to bruce wong for putting up with early, buggy versions.)

during the investigation of this i found that loopback *is* slow for reasons i don't
completely understand.  part of this was the terrible scheduler.  as part of the gsoc
work, we were able to make the nix scheduler not howlingly terrible for 1-8 cpus.  this
improvement depends on the goodness of mcs locks.  i developed a version of this,
but ended up using charles' much cleaner version.  there remain big problems with
the tcp and ip stack.  it's really slow.  i can't get >400MB/s on ethernet.  it seems
that the 3-way interaction between tcp:tx, tcp:rx and the user-space queues is the issue.
queue locking is very wasteful as well.  i have some student code that addresses part
of the latter problem, but it smells to me like ip/tcp.c's direct calls between tx and rx
are the real issue.

- erik



  reply	other threads:[~2015-05-07  3:35 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-04  9:32 KADOTA Kyohei
2015-05-04 16:10 ` Anthony Sorace
2015-05-04 18:11   ` Aram Hăvărneanu
2015-05-04 18:51     ` David du Colombier
2015-05-05 14:29       ` Sergey Zhilkin
2015-05-05 15:05       ` Charles Forsyth
2015-05-05 15:38         ` David du Colombier
2015-05-05 22:23           ` Charles Forsyth
2015-05-05 22:29             ` cinap_lenrek
2015-05-05 22:33             ` David du Colombier
2015-05-05 22:53               ` Aram Hăvărneanu
2015-05-06 20:55                 ` David du Colombier
2015-05-06 21:17                   ` Charles Forsyth
2015-05-06 21:26                     ` David du Colombier
2015-05-06 21:28                       ` David du Colombier
2015-05-06 22:28                         ` Charles Forsyth
2015-05-07  3:35                           ` erik quanstrom [this message]
2015-05-07  6:15                             ` David du Colombier
2015-05-07 13:17                               ` erik quanstrom
2015-05-08 16:13                                 ` David du Colombier
2015-05-08 16:39                                   ` Charles Forsyth
2015-05-08 17:16                                     ` David du Colombier
2015-05-08 19:24                                       ` David du Colombier
2015-05-08 20:03                                         ` Steve Simon
2015-05-08 21:19                                         ` Bakul Shah
2015-05-09 14:43                                           ` erik quanstrom
2015-05-09 17:25                                             ` Lyndon Nerenberg
2015-05-09 17:30                                               ` Devon H. O'Dell
2015-05-09 17:35                                                 ` Lyndon Nerenberg
2015-05-09 21:54                                                   ` Devon H. O'Dell
2015-05-09 18:20                                               ` Bakul Shah
2015-05-09  3:11                                         ` cinap_lenrek
2015-05-09  5:59                                           ` lucio
2015-05-09 16:26                                             ` cinap_lenrek
2015-05-09 16:23                                           ` erik quanstrom
2015-05-10  4:55                                             ` erik quanstrom
2015-05-10  5:07                                               ` erik quanstrom
2015-05-10 17:57                                                 ` David du Colombier
2015-05-10 20:18                                                   ` erik quanstrom
2015-05-10 20:19                                             ` cinap_lenrek
2015-05-10 20:51                                               ` erik quanstrom
2015-05-10 21:34                                                 ` cinap_lenrek
2015-05-11  1:23                                                   ` erik quanstrom
2015-05-09 16:59                                           ` erik quanstrom
2015-05-06 22:35                         ` Steven Stallion
2015-05-06 23:47                           ` Charles Forsyth
2015-05-07  3:38                       ` erik quanstrom
2015-05-07  3:43                 ` erik quanstrom
2015-05-05 15:07     ` KADOTA Kyohei
2015-05-05 14:47   ` KADOTA Kyohei
2015-05-05 15:46     ` steve
2015-05-05 15:54       ` David du Colombier

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=595e28c2c25b6d648085e5d51c5d51f3@lilly.quanstro.net \
    --to=quanstro@quanstro.net \
    --cc=9fans@9fans.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).