A common bottleneck for slow page load times is often the DNS Resolution. To test the amount of time it requires to resolve the DNS, try using
$ dig example.com
This should give you an output along the following lines
; <<>> DiG 9.10.2-P1 <<>> example.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 13362
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;example.com. IN A
;; ANSWER SECTION:
example.com. 1 IN A 188.8.131.52
;; Query time: 3 msec
;; SERVER: 10.0.0.1#53(10.0.0.1)
;; WHEN: Thu Jun 18 23:19:24 IST 2015
;; MSG SIZE rcvd: 45
See the last section? It shows how much time it took to resolve the DNS. With dnsmasq, I would assume that you'll be on a couple of milliseconds or less.
If you seem good here, time to test the actual network. First check if connecting to the domain isn't taking too much time. You should try to ping the domain and look at the rtt times. If the rtt is too great, then the connection latency is probably your culprit.
$ ping -c 5 example.com
PING example.com (184.108.40.206) 56(84) bytes of data.
64 bytes from 220.127.116.11: icmp_seq=1 ttl=51 time=204 ms
64 bytes from 18.104.22.168: icmp_seq=2 ttl=51 time=205 ms
64 bytes from 22.214.171.124: icmp_seq=3 ttl=51 time=206 ms
64 bytes from 126.96.36.199: icmp_seq=4 ttl=51 time=205 ms
64 bytes from 188.8.131.52: icmp_seq=5 ttl=51 time=205 ms
--- example.com ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4001ms
rtt min/avg/max/mdev = 204.315/205.415/206.755/0.785 ms
If this is one second or more, you've definitely got a connection bottleneck.
In case you see something wrong with the output of
ping(1), you can try to profile the connection better using
The output of traceroute should help you to profile the connection and see which part of the path from your machine to the server is causing the maximum delay.
If the ping output looks good, check if the server is taking too much time to send a response back. Try
$ wget -d example.com
DEBUG output created by Wget 184.108.40.206-fd3a-dirty on linux-gnu.
URI encoding = ‘UTF-8’
--2015-06-18 23:27:55-- http://example.com/
Resolving example.com (example.com)... 220.127.116.11, 2606:2800:220:1:248:1893:25c8:1946
Caching example.com => 18.104.22.168 2606:2800:220:1:248:1893:25c8:1946
Connecting to example.com (example.com)|22.214.171.124|:80... connected.
Created socket 4.
Releasing 0x0000000001afc8d0 (new refcount 1).
GET / HTTP/1.1
User-Agent: Wget/126.96.36.199-fd3a-dirty (linux-gnu)
HTTP request sent, awaiting response...
HTTP/1.1 200 OK
Date: Thu, 18 Jun 2015 17:57:56 GMT
Expires: Thu, 25 Jun 2015 17:57:56 GMT
Last-Modified: Fri, 09 Aug 2013 23:54:35 GMT
Server: ECS (ewr/15BD)
Registered socket 4 for persistent reuse.
Length: 1270 (1.2K) [text/html]
Saving to: ‘index.html’
index.html 100%[==========================================================================>] 1.24K --.-KB/s in 0s
2015-06-18 23:27:56 (197 MB/s) - ‘index.html’ saved [1270/1270]
Does the output pause at any location for a long time? Then that step is definitely what is causing the delays.