I'm using Ubuntu 12.04, Chromium 18.0.1025.151 (Developer Build 130497 Linux) Ubuntu 12.04, Firefox 12.0 but I'm getting poor browsing speed. The browser always shows "Waitng for aaa.bbb.com" at the bottom of the browser. How can I debug this and find out the reason? I'm connecting to 3G network via Bluetooth PAN network of an Android device. Some stats below.

$ 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

;asdsa.com.         IN  A

asdsa.com.      307707  IN  A

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.

a.gtld-servers.net. 50538   IN  A
a.gtld-servers.net. 59333   IN  AAAA    2001:503:a83e::2:30
b.gtld-servers.net. 40208   IN  A
b.gtld-servers.net. 45531   IN  AAAA    2001:503:231d::2:30
c.gtld-servers.net. 45531   IN  A
d.gtld-servers.net. 45526   IN  A
e.gtld-servers.net. 45526   IN  A
f.gtld-servers.net. 40177   IN  A
g.gtld-servers.net. 35936   IN  A
h.gtld-servers.net. 40177   IN  A
i.gtld-servers.net. 45526   IN  A
j.gtld-servers.net. 45526   IN  A
k.gtld-servers.net. 35936   IN  A

;; Query time: 227 msec
;; WHEN: Wed Jun  6 22:40:19 2012
;; MSG SIZE  rcvd: 499

$ ping google.com
PING google.com ( 56(84) bytes of data.
64 bytes from maa03s17-in-f7.1e100.net ( icmp_req=1 ttl=54 time=173 ms
64 bytes from maa03s17-in-f7.1e100.net ( icmp_req=2 ttl=54 time=162 ms
64 bytes from maa03s17-in-f7.1e100.net ( icmp_req=3 ttl=54 time=228 ms
64 bytes from maa03s17-in-f7.1e100.net ( icmp_req=4 ttl=54 time=236 ms
64 bytes from maa03s17-in-f7.1e100.net ( icmp_req=5 ttl=54 time=162 ms
64 bytes from maa03s17-in-f7.1e100.net ( icmp_req=6 ttl=54 time=215 ms
64 bytes from maa03s17-in-f7.1e100.net ( icmp_req=7 ttl=54 time=218 ms
64 bytes from maa03s17-in-f7.1e100.net ( icmp_req=8 ttl=54 time=232 ms
64 bytes from maa03s17-in-f7.1e100.net ( icmp_req=9 ttl=54 time=212 ms
--- 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

Also is there a browser that provides more verbose while loading a page?

Edit : more info from the answer of @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
  • start it with the terminal?! and if that aint work add the parameter -debug or -dev, I have no idea if this works, but its worth a try. – Dr_Bunsen Jun 6 '12 at 17:26
  • The problem probably lies in the fact that you're connected through a PAN of a mobile device which is over 3G, which can be slow at times anyway. The slow pings from google kinda suggest that too. – jackweirdy Jun 6 '12 at 17:27
  • Also look at the output of netstat -an to see what open, bandwidth-chewing connections you might have without being aware of it (such as Ubuntu's automatic update mechanism, a forgotten torrent client, etc.) – fluffy Jun 6 '12 at 17:29
  • @jackweirdy I'm not talking about just slow browsing. It loads forever sometimes and when I click go again loads instantly. About slow pings, I'm from India. – Binoy Babu Jun 6 '12 at 17:30
  • @fluffy Nothing is using up bandwidth – Binoy Babu Jun 6 '12 at 17:32

Use curl to find out which part of the process of loading a website is giving you trouble

In general, you can debug "browsing" (or http/s) by using curl with the -w option.

  • Open the terminal, and sudo apt-get install curl (if you don't have it already)
  • Create a file called curl-timing.cfg in say, your home directory. In it, paste:

          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
                 Total time                   :  %{time_total}\n
                 Size of download (bytes)     :  %{size_download}\n
                 Average d/l speed (bytes/s)  :  %{speed_download}\n
  • Then, try downloading any URL, suppose google, with:

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

  • and the output will be of the form:

      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 to fetching a webpage from an Indian server to the US:

    $ 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

  • This will tell which step(s) are the weak link. Try with multiple websites, and even file downloads. If curl gives you good results overall, the problem may lie with your browser/application, instead of TCP/HTTP and your network connection.
  • For more options, see the curl man page. Search for --writeout to quickly jump to the relevant section.
  • 1
    Wow, curl really IS a swiss-army knife at this point. I didn't know about the -w option. Handy! – fluffy Jun 6 '12 at 17:56
  • @izx please see edited question. The output seems fine. Also elinks work fine. When using the affected browser, same page would either load fast (normal) or keep loading forever. What is the browser(Chromium) doing while it displays "Waiting for <host>..."? – Binoy Babu Jun 6 '12 at 18:25
  • Please try it with the sites that are giving you problems - I just used those two as an example. I don't (regularly) use chromium, so my guess would be it is waiting for the connection to be established...the Connect to Server (TCP/HTTP) part. – ish Jun 6 '12 at 19:22
  • 1
    Cool thing! But for me, it says: DNS lookup: 8.5 sec / Connect to server (TCP): 9.0 sec / Total time: 9.6 sec" This doesn't fit together. (?) – Blauhirn Jul 7 '16 at 21:28

protected by Community Apr 15 '17 at 6:04

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.