LinHES Forums
http://forum.linhes.org/

Slow internet, but fast apt-get retrieval? [Solved: IPv6]
http://forum.linhes.org/viewtopic.php?f=5&t=19008
Page 1 of 1

Author:  tzoom84 [ Mon Sep 29, 2008 7:19 pm ]
Post subject:  Slow internet, but fast apt-get retrieval? [Solved: IPv6]

Frustrating that such a simple problem is killing me here. I haven't changed any network settings lately, but it is the first time since the R5.5 install that I am using a browser (Disclaimer: I am not blaming R5.5 for anything. I love it)

apt-get has been working quite quickly even with large multi-megabyte downloads. But pings and my web browser are extremely slow.

Any ideas why browser requests or website pings would be slow, but other stuff fast? See below for more information/examples ...

Pings are ok, and the delays for web retrieval are very high. But retrieving web pages in a browser takes forever. Whats interesting is that when using wget, the delay is very high (~1 min) to start a download, but very fast (180K/s) once connected:

Code:
root@mythtv:/tmp# wget http://knoppmyth.net/phpBB2/viewtopic.php?t=17408
--20:58:44--  http://knoppmyth.net/phpBB2/viewtopic.php?t=17408
           => `viewtopic.php?t=17408'
Resolving knoppmyth.net... 140.211.166.97
Connecting to knoppmyth.net|140.211.166.97|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]

    [  <=>                                ] 60,770       183.02K/s

20:59:05 (182.47 KB/s) - `viewtopic.php?t=17408' saved [60770]


THis made me think delays were due to DNS nameserver lookup, so I added a few nameservers to my /etc/resolv.conf

Code:
nameserver 192.168.1.1
nameserver 167.206.245.130
nameserver 167.206.245.129


And lastly, if anyone is interested, here is my /etc/network/interfaces:

Code:
# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)

# The loopback interface
# automatically added when upgrading
auto lo eth0
iface lo inet loopback

iface eth0 inet static
        address 192.168.1.51
        netmask 255.255.255.128
        network 192.168.1.0
        broadcast 192.168.1.127
        gateway 192.168.1.1

post-up /usr/sbin/ethtool -s eth0 wol g

Author:  jzigmyth [ Tue Sep 30, 2008 6:59 am ]
Post subject:  Re: Slow internet, but fast apt-get retrieval?

tzoom84 wrote:
Code:
nameserver 192.168.1.1
nameserver 167.206.245.130
nameserver 167.206.245.129
You might want to try removing your router (192.168.1.1) as a name server. Because it is first in the list your box will use that one first. So the name server that you will be getting will actually be supplied by your router and you didn't post what your router has in it for nameserver settings. It probably defaults to using your ISPs name servers.

Also, check your router's subnet mask. 255.255.255.128 is somewhat unusual, but not unheard of. Usually it is 255.255.255.0.

Author:  tzoom84 [ Tue Sep 30, 2008 3:07 pm ]
Post subject: 

I looked at my router DNS settings and it turns out those two were the same as the router's settings. So I instead just have 192.168.1.1 as the sole entry in resolv.conf. This afternoon, I am still having slow loadtimes, but its slightly better than yesterday afternoon. Its still far worse than with other computers on the network.

Also, the subnet is 255.255.255.128 to allow for wake-on-lan with a Linksys WRT-54G as described here

Author:  jzigmyth [ Wed Oct 01, 2008 12:51 pm ]
Post subject: 

Possible things to look for:
If you changed your linksys subnet to 255.255.255.128 then only IP addresses in the range of 192.168.1.0 to 192.168.1.127 are valid IPs, with 192.168.1.127 being the broadcast address. Did you also change the range that DHCP is handing out? Are you also using static IPs? Make sure you aren't using a static IP that is inside the current DHCP range.

Go over your router settings digit by digit, looking for typos. Same for the computer settings. Check all the computers on your network, maybe a duplicate IP got assigned or some other bogus setting is upsetting the network.

Check /etc/hosts for suspicious or incorrect entries.

Try flushing the DNS cache. I assume you have tried rebooting. (I don't know if rebooting flushes the cache or not)

Author:  tzoom84 [ Wed Oct 01, 2008 9:03 pm ]
Post subject: 

Thanks for the tips jzig.
Right now the slow-net computer is static IP 192.168.1.51. DHCP is set to start at 192.168.1.100 with max # of users = 27.

Nothing funny seen in the router logs or the DHCP table.

I wasn't sure about the /etc/hosts because I've never really worked with it. But here is mine.
Code:
127.0.0.1       mythtv localhost

# The following lines are desirable for IPv6 capable hosts
# (added automatically by netbase upgrade)

::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts


I rebooted and also (think I) flushed the DNS cache by typing

Code:
# /etc/init.d/pppd-dns stop
# /etc/init.d/dns-clean start
# /etc/init.d/pppd-dns start


I do have a feeling that its DNS related. As an example, I can get relatively quick streams from YouTube once they are going, but it just takes a long time to load the initial page.

Or an example from dslreports.com speed test:
Download - 10476 Kb/s
Upload - 1621 Kb/s
Latency 8ms

(I'm very happy with these resutls, except initial page loads take sooooo long)


...I'll keep at the router settings. Thanks again.

Author:  alien [ Thu Oct 02, 2008 12:06 am ]
Post subject: 

I find the quickest way to see what is going on with something like this is to use wireshark (apt-get install wireshark). You can use it to get a capture of the IP packets of a slow page load, then look to see where the delay is.

Don't be scared off by trying to read IP packets. Wireshark decodes them all in a human-friendly form. If you suspect DNS, just type DNS in the filter and you will see all the DNS msgs. I do a lot of VoIP debugging and wireshark never ceases to amaze me. It even decodes SS7 and has a "play" button to play back what was said on a speech call.

Author:  tzoom84 [ Mon Oct 06, 2008 8:22 pm ]
Post subject: 

Thanks alien. I'm still having initial page load delays so I'll try out wireshark asap. It seems cool for general debugging, for anything (windows or linux)

Author:  tzoom84 [ Mon Oct 13, 2008 9:16 pm ]
Post subject: 

Finally got around to taking a better look at this.
My Wireshark outputs didn't show anything except for delayed responses from the router (~10s before a router response to a DNS request).

After some googling, other folks had similar issues, particularly with my router, the Linksys WRT54G. It turned out it was an IPv6 settings issue. This makes sense since the WRT54G isn't IPv6 compatible and the mythbox was requesting it.

So following this page, there were two main things:

1. Disable IPv6 in the config files. This requires editing BOTH /etc/modprobe.d/aliases, AND /etc/modutils/aliases,
2. Disable IPv6 in the browser (in this case, iceweasel, using about:config)

The link above describes in detail how to do this.

Author:  nbdwt73 [ Tue Oct 14, 2008 9:46 am ]
Post subject: 

There is also another option that addresses this at the router level. Replace the software on the router with a linux based solution (see dd-wrt.com). It is a much superior product that also provides many additional features (including DNS and hardware VPN).

I have seen this issue on many Linksys and D-Link networks - dd-wrt solves it. I have used it for years - the current release is solid.

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/