[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [Debian-NYC] debugging network slowness



Well sort of makes sense, I need to study and review this

OK here is what I got:


steve@francisco:~$ time printf 'GET / HTTP/1.1\nHost: nytimes.com\n\n'|\
> nc 199.239.136.200.80
199.239.136.200.80: forward host lookup failed: Unknown host

real    0m0.341s
user    0m0.012s
sys    0m0.000s
steve@francisco:~$


Does this mean there is a problem with port 80?

Steve


On Fri, Dec 3, 2010 at 7:04 PM, Daniel Kahn Gillmor <dkg@fifthhorseman.net> wrote:
On 12/03/2010 06:25 PM, steve beltzer wrote:
> steve@francisco:~$ grep '^hosts:' /etc/nsswitch.conf
> hosts:          files mdns4_minimal [NOTFOUND=return] dns mdns4
> steve@francisco:~$ time perl -e 'gethostbyname("nytimes.com");'
>
> real    0m0.012s
> user    0m0.004s
> sys    0m0.004s
> steve@francisco:~$ time perl -e 'gethostbyname("nytimes.com"),'
>
> real    0m0.010s
> user    0m0.008s
> sys    0m0.004s
> steve@francisco:~$

The above all looks reasonable.  we're talking roughly a hundredth of a
second to do a DNS lookup.  That's fine on today's network.

> So what does this mean?

It means that there's no problem in your DNS resolution.  That still
leaves open the question of why wget would take 15 seconds just to fetch
a single redirect.

Now that we've ruled out nameservice lookup, let's look at the next
stage: making the TCP connection to the web server and fetching the result.

Here's me doing that by hand:


0 dkg@pip:~$ time printf 'GET / HTTP/1.1\nHost: nytimes.com\n\n' | \
> nc 199.239.136.200 80
HTTP/1.1 301 Moved Permanently
Server: Sun-ONE-Web-Server/6.1
Date: Fri, 03 Dec 2010 23:47:45 GMT
Content-length: 122
Content-type: text/html
Location: http://www.nytimes.com/
nnCoection: close

<HTML><HEAD><TITLE>Moved Permanently</TITLE></HEAD>
<BODY><H1>Moved Permanently</H1>
An error has occurred.
</BODY></HTML>
real    0m0.108s
user    0m0.000s
sys     0m0.004s
0 dkg@pip:~$


Note that my command above is broken into two parts: after the pipe
character ("|"), i put a backslash before hitting enter.  that tells the
shell that i'm not done with the command yet.  So the shell gives me
it's continuation prompt (known as $PS2), which in my case is the string
"> ".

I finished the command pipeline in that prompt by typing in the last
bits ("nc 199.239.136.200 80") and pressing enter.  then the rest of it
is my command.

make sense?

The tool i'm using above is called "netcat".  Remember how "cat" is used
to dump the contents of a file (or many files) to the standard output
(into the terminal)?  netcat does the same thing, but for TCP
connections instead of files.

The arguments to netcat are the target host and the TCP port.  I chose
to specify the target host (the nytimes.com web server) by IP address to
avoid incurring another DNS lookup -- we've already ruled that bit out,
but i don't want to reintroduce it either.  And port 80 is the standard
web port.

The printf part of the pipeline is what we're sending *to* the web
server.  this is about the simplest HTTP/1.1 request you can make.  it
just says "give me the home page of the site named nytimes.com."

The remote web server receives the command, sends back its HTTP
response, and netcat dumps it to standard output, which shows up in the
terminal.

the "time" builtin (part of bash, the shell) times the entire pipeline
from beginning to end.

what do you see when you run this same command pipeline?

       --dkg

PS sorry if it seems like i'm leading you on a wild goose chase that has
nothing to do with iceweasel.  This will eventually lead us back to
iceweasel; i just want to get a sense of which part of the
communications stack is failing for you.

Hopefully you're also becoming more comfortable with these commands and
the command line in the meantime too ;)  Feel free to ask questions if
you want to better-understand any of the steps here, or any of the
concepts involved.


_______________________________________________
DebianNYC mailing list
DebianNYC@vireo.org
http://lists.vireo.org/cgi-bin/mailman/listinfo/debiannyc


_______________________________________________
DebianNYC mailing list
DebianNYC@vireo.org
http://lists.vireo.org/cgi-bin/mailman/listinfo/debiannyc

Reply to: