9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Richard Miller <9fans@hamnavoe.com>
To: 9fans@9fans.net
Subject: 127.0.0.1 considered harmful
Date: Sat, 11 Jul 2020 12:04:22 +0100	[thread overview]
Message-ID: <76ae06f8535410b479c096c5881a69c4@hamnavoe.com> (raw)

This seems weird to me:

cpu% echo $sysname
atom
cpu% ndb/query sys atom ip
192.168.23.25
cpu% ndb/query sys localhost ip
127.0.0.1
cpu% srv atom atom /n/atom
post...
cpu% srv localhost localhost /n/localhost
post...
cpu% time cp /n/atom/386/9pccpuf /dev/null
0.00u 0.02s 0.37r 	 cp /n/atom/386/9pccpuf /dev/null
cpu% time cp /n/localhost/386/9pccpuf /dev/null
0.00u 0.00s 24.54r 	 cp /n/localhost/386/9pccpuf /dev/null
cpu% time cp /n/atom/386/9pccpuf /dev/null
0.00u 0.00s 0.14r 	 cp /n/atom/386/9pccpuf /dev/null
cpu% time cp /n/localhost/386/9pccpuf /dev/null
0.00u 0.00s 24.87r 	 cp /n/localhost/386/9pccpuf /dev/null

Intuitively I would have thought the loopback interface would
be more efficient than going through the ethernet driver.
Certainly not two orders of magnitude slower.

This is on a 386-based cpu + fossil server. The same experiment
on arm and cwfs gives similar results.

It's not about raw bandwidth; streaming in one direction seems ok:

cpu% tcptest & tcptest -i atom -n 10000
cpu% tcp!192.168.23.25!34061 count 10000; 81920000 bytes in 2016503491 ns @ 40.6 MB/s (0ms)

cpu% tcptest & tcptest -i localhost -n 10000
cpu% tcp!127.0.0.1!49090 count 10000; 81920000 bytes in 551924026 ns @ 148 MB/s (0ms)

So the problem seems to be latency of 9p transactions. Could it be
an artifact of tcp flow control not adapting well to the loopback
interface? Can anyone offer an insight?


             reply	other threads:[~2020-07-11 11:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-11 11:04 Richard Miller [this message]
2020-07-11 15:46 ` [9fans] " Ethan Gardener
2020-07-11 18:24   ` David du Colombier
2020-07-11 18:57     ` Richard Miller
2020-07-13  7:04   ` Lucio De Re
2020-07-17  9:40     ` Ethan Gardener

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=76ae06f8535410b479c096c5881a69c4@hamnavoe.com \
    --to=9fans@hamnavoe.com \
    --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).