Como depurar a velocidade de navegação lenta?

10

Estou usando o Ubuntu 12.04, o Chromium 18.0.1025.151 (Developer Build 130497 Linux), o Ubuntu 12.04, o Firefox 12.0, mas estou com pouca velocidade de navegação. O navegador sempre mostra "Waitng for aaa.bbb.com" na parte inferior do navegador. Como posso depurar isso e descobrir o motivo? Estou me conectando à rede 3G via rede Bluetooth PAN de um dispositivo Android. Algumas estatísticas abaixo.

$ dig asdsa.com

; <<>> DiG 9.8.1-P1 <<>> asdsa.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 39878
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 13

;; QUESTION SECTION:
;asdsa.com.         IN  A

;; ANSWER SECTION:
asdsa.com.      307707  IN  A   200.31.91.194

;; AUTHORITY SECTION:
com.            34662   IN  NS  e.gtld-servers.net.
com.            34662   IN  NS  a.gtld-servers.net.
com.            34662   IN  NS  k.gtld-servers.net.
com.            34662   IN  NS  h.gtld-servers.net.
com.            34662   IN  NS  g.gtld-servers.net.
com.            34662   IN  NS  l.gtld-servers.net.
com.            34662   IN  NS  j.gtld-servers.net.
com.            34662   IN  NS  c.gtld-servers.net.
com.            34662   IN  NS  b.gtld-servers.net.
com.            34662   IN  NS  m.gtld-servers.net.
com.            34662   IN  NS  d.gtld-servers.net.
com.            34662   IN  NS  f.gtld-servers.net.
com.            34662   IN  NS  i.gtld-servers.net.

;; ADDITIONAL SECTION:
a.gtld-servers.net. 50538   IN  A   192.5.6.30
a.gtld-servers.net. 59333   IN  AAAA    2001:503:a83e::2:30
b.gtld-servers.net. 40208   IN  A   192.33.14.30
b.gtld-servers.net. 45531   IN  AAAA    2001:503:231d::2:30
c.gtld-servers.net. 45531   IN  A   192.26.92.30
d.gtld-servers.net. 45526   IN  A   192.31.80.30
e.gtld-servers.net. 45526   IN  A   192.12.94.30
f.gtld-servers.net. 40177   IN  A   192.35.51.30
g.gtld-servers.net. 35936   IN  A   192.42.93.30
h.gtld-servers.net. 40177   IN  A   192.54.112.30
i.gtld-servers.net. 45526   IN  A   192.43.172.30
j.gtld-servers.net. 45526   IN  A   192.48.79.30
k.gtld-servers.net. 35936   IN  A   192.52.178.30

;; Query time: 227 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Wed Jun  6 22:40:19 2012
;; MSG SIZE  rcvd: 499


$ ping google.com
PING google.com (74.125.236.199) 56(84) bytes of data.
64 bytes from maa03s17-in-f7.1e100.net (74.125.236.199): icmp_req=1 ttl=54 time=173 ms
64 bytes from maa03s17-in-f7.1e100.net (74.125.236.199): icmp_req=2 ttl=54 time=162 ms
64 bytes from maa03s17-in-f7.1e100.net (74.125.236.199): icmp_req=3 ttl=54 time=228 ms
64 bytes from maa03s17-in-f7.1e100.net (74.125.236.199): icmp_req=4 ttl=54 time=236 ms
64 bytes from maa03s17-in-f7.1e100.net (74.125.236.199): icmp_req=5 ttl=54 time=162 ms
64 bytes from maa03s17-in-f7.1e100.net (74.125.236.199): icmp_req=6 ttl=54 time=215 ms
64 bytes from maa03s17-in-f7.1e100.net (74.125.236.199): icmp_req=7 ttl=54 time=218 ms
64 bytes from maa03s17-in-f7.1e100.net (74.125.236.199): icmp_req=8 ttl=54 time=232 ms
64 bytes from maa03s17-in-f7.1e100.net (74.125.236.199): icmp_req=9 ttl=54 time=212 ms
^C
--- google.com ping statistics ---
9 packets transmitted, 9 received, 0% packet loss, time 8007ms
rtt min/avg/max/mdev = 162.119/204.385/236.105/28.286 ms

Existe também um navegador que fornece mais detalhes ao carregar uma página?

Editar: mais informações da resposta do @izx

$ curl -w "@curl-timing.cfg" -o /dev/null -s http://www.google.com/

      DNS lookup                          :  0.363
      Connect to server (TCP)             :  0.512
      Connect to server (HTTP/S)          :  0.000
      Time from start until transfer began:  0.512
      Time for redirection (if any)       :  0.000
      Total time before transfer started  :  0.749

             Total time                   :  0.749
             Size of download (bytes)     :  221
             Average d/l speed (bytes/s)  :  294.000

$ curl -w "@curl-timing.cfg" -o /dev/null -s http://india.gov.in

      DNS lookup                          :  0.351
      Connect to server (TCP)             :  0.526
      Connect to server (HTTP/S)          :  0.000
      Time from start until transfer began:  0.526
      Time for redirection (if any)       :  0.000
      Total time before transfer started  :  0.770

             Total time                   :  1.643
             Size of download (bytes)     :  34346
             Average d/l speed (bytes/s)  :  20905.000
    
por Binoy Babu 06.06.2012 / 19:22

1 resposta

14

Use curl para descobrir qual parte do processo de carregamento de um website está causando problemas

Em geral, você pode depurar "navegação" (ou http / s) usando curl com a opção -w .

  • Abra o terminal e sudo apt-get install curl (se você ainda não o tiver)
  • Crie um arquivo chamado curl-timing.cfg no seu diretório pessoal. Nele, cole:

    \n
          DNS lookup                          :  %{time_namelookup}\n
          Connect to server (TCP)             :  %{time_connect}\n
          Connect to server (HTTP/S)          :  %{time_appconnect}\n
          Time from start until transfer began:  %{time_pretransfer}\n
          Time for redirection (if any)       :  %{time_redirect}\n
          Total time before transfer started  :  %{time_starttransfer}\n
    \n
                 Total time                   :  %{time_total}\n
                 Size of download (bytes)     :  %{size_download}\n
                 Average d/l speed (bytes/s)  :  %{speed_download}\n
    \n
    
  • Então, tente baixar qualquer URL, suponha google, com:

    curl -w "@curl-timing.cfg" -o /dev/null -s http://www.google.com/

  • e a saída será da forma:

    
    
      DNS lookup                          :  0.012
      Connect to server (TCP)             :  0.031
      Connect to server (HTTP/S)          :  0.000
      Time from start until transfer began:  0.031
      Time for redirection (if any)       :  0.000
      Total time before transfer started  :  0.098
    
             Total time                   :  0.117
             Size of download (bytes)     :  14527
             Average d/l speed (bytes/s)  :  124347.000
    

  • Compare com a busca de uma página da Web de um servidor indiano para os EUA:

    $ curl -w "@curl-timing.cfg" -o /dev/null -s http://india.gov.in
    
    
      DNS lookup                          :  0.377
      Connect to server (TCP)             :  0.716
      Connect to server (HTTP/S)          :  0.000
      Time from start until transfer began:  0.716
      Time for redirection (if any)       :  0.000
      Total time before transfer started  :  1.974
    
             Total time                   :  3.650
             Size of download (bytes)     :  34345
             Average d/l speed (bytes/s)  :  9408.000
    

  • Isso informará quais etapas são o elo fraco. Experimente vários sites e até downloads de arquivos. Se curl fornecer bons resultados gerais, o problema pode estar no navegador / aplicativo, em vez de TCP / HTTP e sua conexão de rede.
  • Para mais opções, consulte a página do manual curl . Pesquise --writeout para acessar rapidamente a seção relevante.
por ish 06.06.2012 / 19:49