Bug 135230

Summary: slow loading webpage -- dhcp, dns, wireless related
Product: [Applications] konqueror Reporter: Pace Sie <ne>
Component: khtmlAssignee: Konqueror Developers <konq-bugs>
Status: CONFIRMED ---    
Severity: normal CC: aspotashev, cooling.crystals, jtamate, kde, kromagg, mactalla.obair, marc, marcus, pmontepagano, rik
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Packet capture from surfing to a page using Firefox
Packet capture from surfing to a page using Konqueror

Description Pace Sie 2006-10-07 00:40:47 UTC
Version:            (using KDE KDE 3.5.2)
Installed from:    Ubuntu Packages
OS:                Linux

Konqueror on my laptop (Dell D620, kubuntu dapper, linux-686) loads webpages 2-4 times slower than firefox.
I'm not sure it is reported or not, a possible cause is mentioned by "elocal" in

http://ubuntuforums.org/archive/index.php/t-76518.html

Specifically, it said:

Problem fixed by putting the DNS IPs that my modem was reporting directly into /etc/resolv.conf.

Konqueror doesn't seem to like the IP of the router as a nameserver, so I just put the DNS IPs from my ISP, as reported by my modem, and it is all set.

Keep in mind that /etc/resolv.conf gets overwritten every time you run a dhcp client, so either use static IP, or prevent your dhcp client from overwriting /etc/resolv.conf (check its respective manpage).


I'd also mention I experience many random crashes with konqueror, most likely some memory problem. Konqueror has very cool features and I'd really love to use it, but there are too many glitches and unstable compared to Firefox.
Comment 1 Pace Sie 2006-10-07 00:45:22 UTC
Much time of my slow loading is "waiting for reply" in status bar, so probably is the dns problem mentioned above.
Comment 2 Maksim Orlovich 2006-10-07 00:59:50 UTC
Please try the KDE_NO_IPV6 suggestion.
Comment 3 Pace Sie 2006-10-12 09:00:15 UTC
Tried it, seems no difference.
Comment 4 Wim De Smet 2006-11-16 17:01:03 UTC
I recently ran into a similar problem on my router. Opening ~10 tabs in konqueror would make many pages load slow or not at all, dns problems would be reported. So I installed a dns proxy (dnsmasq) on my local machine and suddenly performance was tons better.

Sniffing the network traffic of konqueror to the caching dns server vs the dns server to its peers I got the following numbers for opening 9 tabs:
- konqueror made 461 dns requests (many duplicates)
- the dns server translated this into 31 dns requests to its peers

In short, I think what this user is seeing is konqueror flooding his (crappy) nat router so badly with packets that it starts dropping connections and DNS requests end up failing. The reason the above linked workaround works is probably the in-built dns server (which is generally even more crappy) failing, while routing can take a beating. Obviously on my local router (linksys thingy) it can't.

Installing dnsmasq or similar locally is a workaround, I don't know if there's a similar facility built-in to KDE to do some rudimentary caching, but in the future it would perhaps be interesting to make konqueror remember past queries, at least if they all occur on loading the same page.

This is with the debian sid package btw(3.5.5)
Comment 5 Andrew Fuller 2006-11-19 16:21:45 UTC
*** This bug has been confirmed by popular vote. ***
Comment 6 Tako Schotanus 2006-11-19 17:04:16 UTC
"Keep in mind that /etc/resolv.conf gets overwritten every time you run a dhcp client"

At least under RedHat/Fedora you can set PEERDNS=no in the /etc/sysconfig/network-scripts/ifcfg-* to prevent DHCP from overwriting your local DNS settings. No idea if and/or how this works on other distros.
Comment 7 Horacio Sanson 2006-11-20 08:20:55 UTC
To install a local DNS cache in Ubuntu/Kubuntu here are some tips:

http://ubuntu.wordpress.com/2006/08/02/local-dns-cache-for-faster-browsing/

http://piao-tech.blogspot.com/2006/10/local-dns-cache-in-kubuntu-using-pdnsd.html

hope is usefull.
Comment 8 mgolden 2007-01-27 08:52:37 UTC
I to am having this problem.  I see that Konqueror makes loads and loads of of DNS requests that Firefox just doesn't make.  I am attaching two wireshark/ethereal packet captures of the surfing to the same page on the same night.

I believe that there may be some issue here with IPV6 on my firewall/router, or it may just be a problem with the router (since it seems to start generating errors when too many requests are thrown at it) but it seems to me secondary to the obvious point that KDE is making lots of DNS requests it doesn't need to make (and that FF is not making).

If you look at the konqueror version, you will see that around packet 42 it begins to re-query www.dailykos.com (the site I tested against), even though it had already queried it at the beginning.  After about 8 seconds (!) it got a DNS failure response from the router.  As I said, this *might* have had something to do with IP V6 issues, but not necessarily - the router does seem to be making proper IP V6 responses in general.  At any rate, none of these queries need to be there as the DNS has already been determined for this address.

Comment 9 mgolden 2007-01-27 08:54:53 UTC
Created attachment 19434 [details]
Packet capture from surfing to a page using Firefox

See my previous comment re packet capture from Firefox
Comment 10 mgolden 2007-01-27 08:59:10 UTC
Created attachment 19435 [details]
Packet capture from surfing to a page using Konqueror

Packet capture to the same page from Konqueror.  Note the mess everything gets
into around packet 42.	There is no reason for this DNS query at all (and
Firefox doesn't make it), since it's already been queried at the beginning.
Comment 11 mgolden 2007-01-27 09:06:55 UTC
P.S.  I would be interested in adding DNS caching to kde if someone would point me at the parts of the code I should be looking at.
Comment 12 Nicolas Dietrich 2009-05-16 14:50:21 UTC
If anybody stumbles upon this problem - it still exists in KDE 4.2.3 and can still be solved by using a proper nameserver in /etc/resolv.conf instead of the local router. Setting KDE_NO_IPV6=true in /etc/environment also seems to do it.

This has been the major reason for not using Konqueror for me, glad I looked for an existing bug report!
Comment 13 Wim De Smet 2009-05-16 16:58:27 UTC
Surely this bug can be confirmed? It's still set to NEW after all this time...
Comment 14 marc 2009-10-23 18:47:33 UTC
I see this issue as well (currently with KDE 4.2.4), but it existed in KDE 3.x

I have to use the ISP's DNS address in /etc/resolv.conf (rather than the router's DNS forwarder) because sendmail doesn't work with the router's DNS (don't know why...).

By observation I've found my router's NAT table is limited to 512 entries.
After a period of intensive browsing (or restore old konqueror sessions after logout/reboot) the router's NAT table is filled with DNS queries and no more TCP connections can be made. This means web pages can't be displayed, and other network apps (and other computers) suffer loss of internet service.

It seems Konqueror makes excessive DNS queries and is even worse if IPv6 is enabled. Blacklisting the IPv6 kernel module (via /etc/modprobe.d/blacklist.conf) helps a lot.

Running "nscd" (name service cache daemon) also helps, but is not a complete solution either. (It doesn't help the konqueror restore sessions case.)

I'd like to see konqueror make fewer gratuitous DNS queries.
Comment 15 Pablo Montepagano 2009-10-24 02:05:09 UTC
Could you do some tests with and without dnsmasq?
I would, but I don't know how to do the testing. I haven't used konqueror much lately, but I believe it's not as slow as it was in KDE3.5. It's still seems slower than others at fetching.
Comment 16 Jaime Torres 2009-12-16 11:43:01 UTC
There is a configuration parameter for the dns queries for khtml. By default, for every <a href="...."> in a page a dns query is made in parallel with the page load.
To avoid this behaviour, modify the .kde(x)/share/config/khtmlrc file and add in the group [HTML Settings] the entry DNSPrefetch=disabled

[HTML Settings]
DNSPrefetch=disabled

After that, even without disabling IPv6 it should work as expected.
Could you do some tests and share your results?
Comment 17 Andrew Fuller 2009-12-29 20:02:01 UTC
Thanks for that config option.  I don't have test numbers, but I've been running with that option for a number of days now and it does feel snappier.

Is there a reason that this is not set by default?