If you are looking for the epic motorcycle journey blog that I've written, please see the Miles By Motorcycle site I put together. 
  • Slow DNS Lookups in Ubuntu 9.10 (Karmic Koala)
    01/28/2010 11:28PM

    One of the most frustrating things about Ubuntu/Kubuntu 9.10 (and 9.04) is the random but frequent 20 sec DNS lookup delay that happens when IPV6 is enabled. Apparently, the resolver first attempts an IPV6 lookup, even if no interfaces are defined. It will sit and time out, at random, for 20 seconds before attempting the IPV4 lookup.

    There are a number of proposed fixes. One is to turn of IPV6 in firefox. This seems to work for a while, but then fails.

    Here's a link to article about turning off IPV6 in Ubuntu:

    http://www.ubuntugeek.com/how-to-disable-ipv6-in-ubuntu.html

    In grub, to turn off IPV6 edit /etc/default/grub and change

    GRUB_CMDLINE_LINUX_DEFAULT=quiet splash

    to

    GRUB_CMDLINE_LINUX_DEFAULT=ipv6.disable=1 quiet splash

     run

    update-grub

    and reboot.

    It's not clear to me yet whether this actually works around the problem or not. Initially on reboot, opening 20 some tabs in firefox seemed much quicker than before but I did get a long hang once I brought up thunderbird. So it may not be a fix after all. Only time will tell.

    To turn off IPV6 in firefox (which doesn't seem to work around the issue but is probably good to know):

    Enter about:config in the URL bar then and search for:

    network.dns.disableIPv6

    and set it to true.

    Here's a link to a very long bug report discussion on the subject:

    https://bugs.launchpad.net/ubuntu/+source/eglibc/+bug/417757?comments=all

    2010-02-03 Update:

    Even with all these changes, I was continuing to get DNS timeouts until I came upon this bug in launchpad (which of course I found /after/ commenting on the bug above, figures:

    https://bugs.launchpad.net/ubuntu/+source/nss-mdns/+bug/94940

    Editing /etc/nsswitch.conf and changing

       hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4

    to

       hosts: files dns

     seems to /finally/ get the DNS lookup performance I would expect.

    Update 2010-02-18 - spoke too soon:

    While initial network connection speeds seem to improve from the steps above, it quickly became apparent that there's still a problem with networking. This seems to happen primarily when I do multiple simultaneous network connections.

    Here's a thread on the subject, which may or may not be useful:

    http://ubuntuforums.org/showthread.php?t=1395866&highlight=slow+internet

    Update 2010-02-21 - ok, maybe it's "fixed" now

    Based on a forum post I read somewhere about the latest kernels implementing some standard too stringently, I decided to try to upgrade the firmware for my DLink DI-707 firewall gadget. It had been a firmware version 2.51. I upgraded it to version 2.57. I immediately noticed an improvement in network performance. My initial tests are not able to reproduce the problem I was seeing, but it's too early to tell for sure.


  • Comment By:
    647
    01/29/2010 8:41AM
    Thanks for finding this. I'll try this today and let you know if I see any better performance on my 9.04 box.
  • Comment By:
    Yermo
    01/29/2010 1:26PM
    It seems to improve things but doesn't fix the problem completely. If I have many simultaneous DNS requests I still get timeouts. There seems to be some kind of race condition.
  • Comment By:
    647
    01/29/2010 1:36PM
    That sounds about right. I've not had a chance to test it. I've got too many applications open and too many things running.
  • Comment By:
    Yermo
    02/14/2010 11:38AM
    No joy. Ubuntu 9.10 (Karmic Koala) is still suffering random network delays. My feeling is that it's a race condition.

    Bug links:

    https://bugs.launchpad.net/ubuntu/+bug/433972

    https://bugs.launchpad.net/ubuntu/+source/eglibc/+bug/4...
  • Comment By:
    Ian
    02/14/2011 12:33PM
    I find that Firefox sometimes takes a long time to do a DNS lookup for a site that I just recently visited. I run 'named' on my workstation, have only "nameserver 127.0.0.1" in my resolv.conf file, and the address that Firefox is trying to look up is already cached, meaning it should take a couple of milliseconds to get the address, not five or ten seconds.

    I run OpenBSD, so if this is related it would be strictly a Firefox thing. As you suggested above, I set network.dns.disableIPv6 to true. Do you think it's related? What the hell is Firefox doing?
  • Comment By:
    Yermo
    02/14/2011 3:17PM
    There's been a thread recently on the bug report over at Ubuntu about this. They are /finally/ figuring out what the issue is. There is supposed to be a fix coming down the pike in FireFox to address it but I don't know what the status is.
  • Comment By:
    Ian
    02/14/2011 3:39PM
    Too early to tell, and again, I'm not using Ubuntu or even linux, but since setting the Firefox setting network.proxy.socks_remote_dns to true (default is false) I haven't had the problem. I haven't seen any proper documentation of this setting, but I think it's supposed to bypass whatever internal lookup mechanism Firefox uses and just goes right to my local resolver. I'll report back after more time has passed.
  • Comment By:
    Yermo
    02/14/2011 3:42PM
    Thanks for the update.
  • Comment By:
    Ian
    02/16/2011 11:54AM
    It's been two days and the change to network.proxy.socks_remote_dns seems to have cured the problem I was having. No more long "Looking up ..." delays.
  • Comment By:
    Yermo
    02/16/2011 2:15PM
    Ok. Cool. Thanks for the update!
You must be logged into an account to post comments.