I have a dual boot set up with Windows and Ubuntu. When I'm using Windows, web browsing is a lot faster than when I'm using Ubuntu and I don't know why. It's like there's just a big latency rather than the maximum speed is lower, there's a big delay before anything happens when using Ubuntu, it happens with all websites all the time. I've never configured the Internet connection because it just worked straight away. I have a broadband connection through a router shared with some other computers. When we set up the router and Internet connection everything was done with Windows. What could I do to fix this?
5 Answers
Are you using Firefox? It's dog slow on my PC as well for some reason.
I've installed Google Chrome and Opera - and they just fly.
Also - try this as well: (thanks to Ubuntu Geek)
Open your Firefox and type about:config at URL address bar and hit enter. To make a False into True, select the line to change, and double click. On the 2nd option change, right click and select Modify
network.http.pipelining > Make it True
network.http.pipelining.maxrequests > Make it 8 or 10
network.http.proxy.pipelining > Make it True
network.dns.disableIPv6 > Make it True
-
-
-
That's odd, in my experience Google Chrome is significantly slower than Firefox. Opera is a good one too. – NoBugs Apr 27 '14 at 02:11
-
Thanks, I know this is an old question, but I found your answer prety good. For me Chrome has been a big problem, it does not remember my logins and had to re-type all the passwords after each restart. FF is working really good but it was damn slow! – FarhadA Dec 27 '16 at 05:08
I have experienced that problem, which I fixed by running my own DNS cache. This will almost certainly speed things up, though who could say definitely the problem you have? I don't know if you have dnsmasq or bind9, but it won't hurt to try to uninstall them. So let's try to remove them, if they exist - replacing them with the dnscache portion of djbdns, killing off any instance of dnsmasq - if running - and removing the BIND start-up script - if it exists.
sudo apt-get remove bind9 dnsmasq-base
sudo apt-get install djbdns dnscache-run
sudo killall -9 dnsmasq
sudo update-rc.d -f bind9 remove
Then we'll need to tell the system to use our cache.
gksu gedit /etc/resolv.conf
Edit the file to look like this example. This file defines which name servers to use, the default domain, and the search suffix. The search suffix makes it possible to run queries using only the hostname portion of a fully-qualified domain name. For exmaple, 'nslookup www' automagically becomes 'nslookup www.example.com' when example.com is the value of the "search" parameter.
nameserver 127.0.0.1 # Use the local resolver first.
nameserver 208.67.222.222 # OpenDNS
nameserver 208.67.220.220 # OpenDNS
domain example.com
search example.com
This is a little fancy, but we need to get the lastest root name servers.
sudo dnsip $(dnsqr ns . | sed -e '/answer/!d;s/\(.*\)NS \(.*\)/\2/') | sudo tee /etc/dnscache/root/servers/@
I think the resolv.conf file is overwritten when we use DHCP. So let's give ourselves a static IP address, removing the software that squashes it, and editing our interfaces file to set up the static IP address.
sudo apt-get purge network-manager network-manager-gnome
gksu gedit /etc/network/interfaces
My interfaces file looks as follows, but modify yours to your configuration.
# Loopback
#
auto lo
iface lo inet loopback
First network card (attached to NAT router, attached to cable internet)
auto eth0
iface eth0 inet static
address 192.168.1.254
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
Now let's just restart.
sudo reboot
Now you are using a local resolver and the latest root servers. This is much, much faster and more reliable than what I happen to get from my ISP, which is so very slow. Does this help the slow-problem you have?
UPDATE
Or - if you don't want to run your own cache (above), and per the conversation below, you could just log into your router and configure it to provide alternate DNS servers, like Google and OpenDNS: 8.8.8.8, 208.67.222.222, 208.67.220.220. This would fix slow DNS also.
-
1
- Why do you need the dns root servers for a DNS Cache?. That's a full DNS for me.
– Javier Rivera Jan 13 '11 at 14:43 -
1
- Static IP, just to avoid DHCP changing the DNS?. Isn't it overkill?. Why have you used the interfaces file instead of network manager?
– Javier Rivera Jan 13 '11 at 14:43 -
- Windows uses the main DNS FIRST. It only fallbacks to the other DNS if the primary fails. What is true is that it keeps using the secondary for a couple of minutes.
– Javier Rivera Jan 13 '11 at 14:44 -
@JavierRivera Well, on (1) the root servers change, so we want whichever ones are current; on (2) maybe you can configure network manager not to squash the file, but when it does squash it, we can't use the local cache; on (3) thanks! I stand corrected. – Jan 13 '11 at 14:53
-
- Sure, but if you are querying the root DNS this is not a DNS cache, it's just a DNS server. At least IMHO. (2) For me the proper way is to add prepend domain-name-servers 127.0.0.1 to the /etc/dhcp3/dhclient.conf file.
– Javier Rivera Jan 13 '11 at 15:09 -
@JavierRivera That's a great, great idea about dhclient.conf! Thank you. Though, it certainly is a DNS cache. :) (The difference between a caching name server and an authoritative name server is that the authoritative name server only answers questions about its own domains, whereas a caching name server will answer questions about any domain, which means that it certainly does need root servers, and having a list of the current root servers to use is more beneficial than using a list of maybe outdated root servers. Some people combine authoritative and caching servers. – Jan 13 '11 at 15:17
-
Maybe it's just a semantic question, but I always understand a DNS cache as a DNS server that queries your ISP DNSs, not root when it's asked from some record not in his memory. It's likely that you are right in this point. – Javier Rivera Jan 13 '11 at 15:26
-
@JavierRivera DNS is sometimes confusing - no doubt. The ISP DNS is a caching name server, or maybe both a caching and an authoritative name server (like a BIND configuration); and also, the local computer caches answers as well. The thing is here that bypassing the ISP cache in favor of a very fast local resolver, we may well solve the slow problem. :) – Jan 13 '11 at 15:42
-
I know, I know. What I was trying to explain is that I have always called a DNS cache a DNS server that only queries the ISP servers, not the root ones. So it's acting like a local cache to your ISP DNSs, not as a local cache of the full net. I hope that I managed to explain it better now. But you're right this kind of cache is a waste of time, as browser will do it themselves. So, you're right in all the possible practical matters. – Javier Rivera Jan 13 '11 at 16:16
-
BTW: I cleaner solution could be to configure the router to use some alternative DNSs, like Open DNS or google's (I love that 8.8.8.8 IP, it's great for those of us with terrible memory). – Javier Rivera Jan 13 '11 at 16:17
-
@JavierRivera The ISP cache uses root servers & forwards answers back, but we skip the middleman. Try 'time www.somedomain.com' (that isn't in cache) to see how long it takes. With this configuration, it takes me 0.038 seconds. Google is fast 'nslookup www.somdomain.com 8.8.8.8' at 0.298 and OpenDNS at 0.228; but my ISP is 3.132!! I doubt I could tell the difference between 0.038 and 0.298. So, would we agree then, that adding 8.8.8.8, 208.67.222.222, 208.67.220.220 to /etc/dhcp3/dhclient.conf (or assigning them though the router) is really the simplest way without using a local caching DNS? – Jan 13 '11 at 16:56
-
Try some popular domain that is not in your cache. Chances are that Google and OpenDNS have it cached and they are faster than a root+authoritative lookups. – Javier Rivera Jan 13 '11 at 18:53
-
@JavierRivera The dhclient.conf method is not easy/acceptable for a single workstation, because the DHCP server expects that it uses a static address. Trying to start the DHCP server, when it is also a DHCP client, causes the DHCP server start-up to fail with "No subnet declaration for eth0 (0.0.0.0)". You'd need a hack or a separate DHCP server. – Jan 14 '11 at 17:08
-
Why are you trying to start a server?. dhclient.conf is used to configure the dhcp client, not the server. – Javier Rivera Jan 15 '11 at 23:22
-
You may be suffering from bufferbloat. It manifests itself as huge latencies when you're transmitting or receiving a lot of data.
I've had success doing the following:
Run ifconfig
and look for "txqueuelen" in it. The default on almost every machine I've seen is 1000.
Lower the size of your transmit buffer to 50. (Almost every modern chipset will support 0, but some don't, so we'll go with 50 for safety reasons).
sudo ifconfig eth0 txqueuelen 50
To restore the original setting:
sudo ifconfig eth0 txqueuelen 1000
As of note, this MAY bump you off the network temporarily - you may need to force your machine to reconnect to the network (unplug/replug cable, sudo ifconfig eth0 up
, etc.)
The short version of what this does - TCP expects packets to be dropped and/or not acknowledged in a timely manner. When it encounters these situations it sends out less data to better adapt to the network. By having a huge transmit queue, the queue delays any adaptation the TCP stack would make, and you get these huge latencies and bad throughput because you're sending more data than the network can handle. The "feedback loop" is delayed by the size of the buffers.
Windows XP isn't affected, because it's got other limits on outgoing data and can't saturate lines like Linux & other more modern OS's can.

- 1,161
-
Ok so I don't know what happened. I tried this. Internet stopped completely, I got scared and reverted back to 1000. Internet got fast. – Aayush Oct 14 '11 at 06:56
-
-
I just realized that, it's the next morning. How to fix this permanently? – Aayush Oct 15 '11 at 06:32
-
I know this is an old thread but as I was looking for the answer so would be others so I decided to post.
I had the same problem . In windows everything works fine but in ubuntu some websites would not open taking forever to open. I solved it by changing my modem from "DIAL ON DEMAND" mode to "ALWAYS ON" mode.

- 11
Edit your /etc/resolv.conf
file, remove everything but Google's DNS servers:
nameserver 8.8.8.8
nameserver 8.8.4.4
& restart the computer.
Make a CURL analysis to find out what exactly is causing the trouble: https://askubuntu.com/a/147385/378854
sudo apt-get remove bind9 dnsmasq-base
this command killed both my ethernet and wifi connections. DO NOT REMOVEdnsmasq-base
took me a few hours to get it back up. – Apr 22 '13 at 22:08ping google.com
andping 8.8.8.8
? – Braiam May 20 '14 at 18:24