Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Browser slowness [SOLVED with a workaround]
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
NathanZachary
Moderator
Moderator


Joined: 30 Jan 2007
Posts: 2605

PostPosted: Sun Oct 26, 2008 4:21 pm    Post subject: Browser slowness [SOLVED with a workaround] Reply with quote

Hello all,

I am really frustrated because I've been working on this issue for days and can't seem to get it resolved. On this particular machine, I dual-boot with Windows. In Windows, using Firefox and Opera, my browsing is quite quick. There is very little latency from the time I type in an address and hit enter until the page is displayed (using various websites as tests). In Gentoo, using Firefox and Konqueror, the browsing is very slow. When I open Firefox and type in one of the same addresses that I used as a test in Windows, it takes at least 5-7 seconds to get past the "looking for..." and "connecting to..." in the status bar. However, if I then go to another site, and come back (without closing Firefox), it performs normally. OR, if I then click a link on an internal link on the site, it is fast. If I close Firefox, wait for a second, reopen it, and try again, the sluggishness returns.

From the terminal, my ping shows nothing suspicious:

Code:

PING www.gentoo.org (209.177.148.229) 56(84) bytes of data.
64 bytes from loon.gentoo.org (209.177.148.229): icmp_seq=1 ttl=54 time=65.0 ms
64 bytes from loon.gentoo.org (209.177.148.229): icmp_seq=2 ttl=54 time=64.6 ms
64 bytes from loon.gentoo.org (209.177.148.229): icmp_seq=3 ttl=54 time=64.7 ms


Does anyone have any idea what I should try in terms of troubleshooting?

Thank you preemptively.
_________________
“Truth, like infinity, is to be forever approached but never reached.” --Jean Ayres (1972)
---avatar cropped from =AimanStudio---


Last edited by NathanZachary on Sun Oct 26, 2008 11:42 pm; edited 1 time in total
Back to top
View user's profile Send private message
Hypnos
Advocate
Advocate


Joined: 18 Jul 2002
Posts: 2889
Location: Omnipresent

PostPosted: Sun Oct 26, 2008 4:34 pm    Post subject: Reply with quote

Brainstorming, sounds like your web browsers have a DNS resolution problem.

Do any other tools on your Gentoo install take a long time to resolve hosts? Obviously 'ping' works, though how long does it take to resolve before sending the first packet?
_________________
Personal overlay | Simple backup scheme
Back to top
View user's profile Send private message
NathanZachary
Moderator
Moderator


Joined: 30 Jan 2007
Posts: 2605

PostPosted: Sun Oct 26, 2008 4:56 pm    Post subject: Reply with quote

Ping resolves the host almost immediately and then starts to send the first packet. Thunderbird seems to take a little bit to resolve as well when sending or receiving mail. Are there any other tools that I should try? Off the top of my head, I can't think of anything else that needs to resolve. Although, when dhcp starts up at boot time, it takes 5-6 seconds to get an IP and check it against the network. Thanks for your help thus far!
_________________
“Truth, like infinity, is to be forever approached but never reached.” --Jean Ayres (1972)
---avatar cropped from =AimanStudio---
Back to top
View user's profile Send private message
Hypnos
Advocate
Advocate


Joined: 18 Jul 2002
Posts: 2889
Location: Omnipresent

PostPosted: Sun Oct 26, 2008 5:07 pm    Post subject: Reply with quote

You can try nslookup and dig (in the package bind-tools) to manually resolve some hosts on the commandline and see performance. With these tools you can specify a nameserver other than the default one provided by DHCP (stored in /etc/resolve.conf), and see if that helps.

You should also make sure that /etc/nsswitch.conf reads
Code:
hosts:       files dns
networks:    files dns

and that /etc/host.conf reads
Code:
order hosts, bind

unless you are knowingly running some other name service like RADIUS or Kerberos.

Finally, make sure /etc/hosts has your localhost aliases:
Code:
# IPv4 and IPv6 localhost aliases
127.0.0.1   foo.bar foo localhost
::1      localhost
.
Sometimes a missing alias here causes weird freakouts with applications that use local sockets but not with applications that don't.
_________________
Personal overlay | Simple backup scheme
Back to top
View user's profile Send private message
NathanZachary
Moderator
Moderator


Joined: 30 Jan 2007
Posts: 2605

PostPosted: Sun Oct 26, 2008 5:26 pm    Post subject: Reply with quote

Well, /etc/nsswitch.conf and /etc/host.conf both have those respective lines (along with the other expected lines). My /etc/hosts has the following:

Code:

# IPv4 and IPv6 localhost aliases
127.0.0.1       bluetux         localhost
::1             localhost


with bluetux being the name specified in /etc/conf.d/hostname.

Also, when I use dig without any @server arguments (which I assume uses my current DNS from /etc/resolv.conf), I get the following:

Code:

dig yandex.ru

; <<>> DiG 9.4.2-P2 <<>> yandex.ru
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 32267
;; flags: qr rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;yandex.ru.                     IN      A

;; ANSWER SECTION:
yandex.ru.              50      IN      A       213.180.204.11
yandex.ru.              50      IN      A       87.250.251.11
yandex.ru.              50      IN      A       77.88.21.11
yandex.ru.              50      IN      A       93.158.134.11

;; Query time: 8 msec
;; SERVER: 192.168.0.1#53(192.168.0.1)
;; WHEN: Sun Oct 26 12:24:51 2008
;; MSG SIZE  rcvd: 91


Does that reveal any information that might help with further troubleshooting? Thanks again.
_________________
“Truth, like infinity, is to be forever approached but never reached.” --Jean Ayres (1972)
---avatar cropped from =AimanStudio---
Back to top
View user's profile Send private message
Hypnos
Advocate
Advocate


Joined: 18 Jul 2002
Posts: 2889
Location: Omnipresent

PostPosted: Sun Oct 26, 2008 5:34 pm    Post subject: Reply with quote

8 milliseconds is pretty good for a DNS resolution. :)

nslookup behaves similarly?

Also, have you tried both with sites that you have not visited since the problem started?

If all the command line tools behave as expected, but your GUI applications don't, then there's probably a bug with some support library -- that would be annoying to diagnose.
_________________
Personal overlay | Simple backup scheme
Back to top
View user's profile Send private message
think4urs11
Bodhisattva
Bodhisattva


Joined: 25 Jun 2003
Posts: 6659
Location: above the cloud

PostPosted: Sun Oct 26, 2008 5:38 pm    Post subject: Reply with quote

Hypnos wrote:
8 milliseconds is pretty good for a DNS resolution. :)

with the DNS server located in the same subnet? I'd expect much lower values than that but obviousely this time isn't the reason for the slowness seen.

@kalos:
What happens when you use your ISPs DNS servers directly instead of your router (or alternatively the OpenDNS ones)?
_________________
Nothing is secure / Security is always a trade-off with usability / Do not assume anything / Trust no-one, nothing / Paranoia is your friend / Think for yourself
Back to top
View user's profile Send private message
NathanZachary
Moderator
Moderator


Joined: 30 Jan 2007
Posts: 2605

PostPosted: Sun Oct 26, 2008 5:48 pm    Post subject: Reply with quote

@Hypnos,

Here's the output from dig on a site I've never visited:

Code:

dig facebook.com

; <<>> DiG 9.4.2-P2 <<>> facebook.com
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 19746
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;facebook.com.                  IN      A

;; ANSWER SECTION:
facebook.com.           143     IN      A       69.63.178.11
facebook.com.           143     IN      A       69.63.176.140

;; Query time: 19 msec
;; SERVER: 192.168.0.1#53(192.168.0.1)
;; WHEN: Sun Oct 26 12:42:50 2008
;; MSG SIZE  rcvd: 62


19 msec is high, but I don't think it's causing this absurd slowdown.

@Think4UrS11,
Here's a dumb question, but should I just use the domain for my ISP's DNS? Where can I find which DNS is being used? I know that in /etc/resolv.conf it just says:

Code:

search sbcglobal.net
nameserver 192.168.0.1


which indicates that it is just using my router's DNS. Sorry for the n00b questions, and thank you both for the help so far.
_________________
“Truth, like infinity, is to be forever approached but never reached.” --Jean Ayres (1972)
---avatar cropped from =AimanStudio---
Back to top
View user's profile Send private message
think4urs11
Bodhisattva
Bodhisattva


Joined: 25 Jun 2003
Posts: 6659
Location: above the cloud

PostPosted: Sun Oct 26, 2008 5:54 pm    Post subject: Reply with quote

hmm either you can find the DNS servers on the papers you got from your ISP, somewhere on their website or you use the OpenDNS ones (208.67.222.222 and 208.67.220.220)

btw: i see some 50-60ms for dns resolution for unknown-to-my-router names and i don't have issues from that
_________________
Nothing is secure / Security is always a trade-off with usability / Do not assume anything / Trust no-one, nothing / Paranoia is your friend / Think for yourself
Back to top
View user's profile Send private message
NathanZachary
Moderator
Moderator


Joined: 30 Jan 2007
Posts: 2605

PostPosted: Sun Oct 26, 2008 6:09 pm    Post subject: Reply with quote

Interestingly, when using dig @208.67.222.222, I get a higher query time by almost 15 ms. So, I don't think that is the problem. However, when I put in the AT&T DNS server, the lookup times are MUCH higher:

Code:

dig @68.94.156.1 calumetphoto.com

; <<>> DiG 9.4.2-P2 <<>> @68.94.156.1 calumetphoto.com
; (1 server found)
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 36635
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;calumetphoto.com.              IN      A

;; ANSWER SECTION:
calumetphoto.com.       3600    IN      A       208.66.174.27

;; Query time: 2303 msec
;; SERVER: 68.94.156.1#53(68.94.156.1)
;; WHEN: Sun Oct 26 13:07:53 2008
;; MSG SIZE  rcvd: 50


Could that be causing the problem?

EDIT: scratch that; it seems to be unrelated. When I used their servers again to look up another site, it was only 8 ms.
_________________
“Truth, like infinity, is to be forever approached but never reached.” --Jean Ayres (1972)
---avatar cropped from =AimanStudio---
Back to top
View user's profile Send private message
postrelenok
n00b
n00b


Joined: 24 Sep 2008
Posts: 9

PostPosted: Sun Oct 26, 2008 8:20 pm    Post subject: Reply with quote

Run your own name server, just install bind and add /etc/init.d/named to default runlevel. It will reduce DNS resolution latency because name server is on your machine. The problem could be not with DNS resolution at all. GUI applications are much slower on linux than on w$$, it's obvious for those people who used not latest high performance hardware - it happens probably because GUI code is not part of the kernel and using GUI applications involves transferring data from user space to kernel space and vise versa.
Back to top
View user's profile Send private message
notHerbert
Advocate
Advocate


Joined: 11 Mar 2008
Posts: 2228
Location: 45N 73W

PostPosted: Sun Oct 26, 2008 9:45 pm    Post subject: Reply with quote

...or just remove the search line in /etc/resolv.conf
/etc/resolv.conf:
nameserver 192.168.0.1
should be sufficient.


:)
Back to top
View user's profile Send private message
NathanZachary
Moderator
Moderator


Joined: 30 Jan 2007
Posts: 2605

PostPosted: Sun Oct 26, 2008 9:53 pm    Post subject: Reply with quote

@notHerbert,

When I remove that line, it comes back.

@postrelenok,

I don't know how it could be a problem with Linux entirely, since my other machines and my Arch/PCLOS installations on this machine don't exhibit the problem.
_________________
“Truth, like infinity, is to be forever approached but never reached.” --Jean Ayres (1972)
---avatar cropped from =AimanStudio---
Back to top
View user's profile Send private message
notHerbert
Advocate
Advocate


Joined: 11 Mar 2008
Posts: 2228
Location: 45N 73W

PostPosted: Sun Oct 26, 2008 10:11 pm    Post subject: Reply with quote

That must be because you are running your network with dhcp?
Back to top
View user's profile Send private message
NathanZachary
Moderator
Moderator


Joined: 30 Jan 2007
Posts: 2605

PostPosted: Sun Oct 26, 2008 10:41 pm    Post subject: Reply with quote

It is. Even though I have DSL, I've found that if I simply assign my router to an address like 192.168.n.x (where n is greater than 1), I can use DHCP instead of PPPoE.
_________________
“Truth, like infinity, is to be forever approached but never reached.” --Jean Ayres (1972)
---avatar cropped from =AimanStudio---
Back to top
View user's profile Send private message
NathanZachary
Moderator
Moderator


Joined: 30 Jan 2007
Posts: 2605

PostPosted: Sun Oct 26, 2008 10:52 pm    Post subject: Reply with quote

I believe I have solved the problem, but not in a completely satisfactory manner. I went to the Firefox config (about:config), and disabled the ipv6 support by setting network.dns.disableIPv6 to true. There is still a little bit of a delay, but I believe it is normal since it is comparable to my other distros. Are there any serious problems that will occur because of this change? I was thinking about getting rid of ipv6 support entirely for the time being. Any suggestions or information either way?

Thanks to everyone for the help thus far.
_________________
“Truth, like infinity, is to be forever approached but never reached.” --Jean Ayres (1972)
---avatar cropped from =AimanStudio---
Back to top
View user's profile Send private message
notHerbert
Advocate
Advocate


Joined: 11 Mar 2008
Posts: 2228
Location: 45N 73W

PostPosted: Sun Oct 26, 2008 10:56 pm    Post subject: Reply with quote

Well, if you give your box a static address, then your resolv.conf will not be changed.
As an example of a static address - my /etc/conf.d/net
Code:
# This blank configuration will automatically use DHCP for any net.*
# scripts in /etc/init.d.  To create a more complete configuration,
# please review /etc/conf.d/net.example and save your configuration
# in /etc/conf.d/net (this file :]!).

config_eth0="192.168.2.2 netmask 255.255.255.0 brd 192.168.2.255"
routes_eth0="default via 192.168.2.1"

This is a very simple one and works very well for my needs. I think there is a way to configure dhcp to not overwrite /etc/resolv.conf. Perhaps the nodns option?
Back to top
View user's profile Send private message
notHerbert
Advocate
Advocate


Joined: 11 Mar 2008
Posts: 2228
Location: 45N 73W

PostPosted: Sun Oct 26, 2008 11:01 pm    Post subject: Reply with quote

I don't use IPv6. I think that at this time it is not necessary unless you know that you need it.

Here are a few more firefox about:config tweaks
Code:
network.http.pipelining true
network.http.pipelining.maxrequests 30
network.http.proxy.pipelining true
plugin.expose_full_path true
nglayout.initialpaint.delay 0
ui.submenuDelay 0
layout.spellcheckDefault 2
browser.cache.memory.capacity 16384
content.maxtextrun 5000
network.ftp.idleConnectionTimeout 60
network.http.keep-alive.timeout 30
Back to top
View user's profile Send private message
NathanZachary
Moderator
Moderator


Joined: 30 Jan 2007
Posts: 2605

PostPosted: Sun Oct 26, 2008 11:03 pm    Post subject: Reply with quote

Thanks for the additional advice. I am thinking about just changing my USE flags to disable ipv6, and then recompiling. However, I would imagine that would require an emerge -avuDN system && emerge -avuDN world to fully get rid of ipv6.
_________________
“Truth, like infinity, is to be forever approached but never reached.” --Jean Ayres (1972)
---avatar cropped from =AimanStudio---
Back to top
View user's profile Send private message
notHerbert
Advocate
Advocate


Joined: 11 Mar 2008
Posts: 2228
Location: 45N 73W

PostPosted: Sun Oct 26, 2008 11:11 pm    Post subject: Reply with quote

I have -ipv6 in make.conf. Just as a test I changed it to ipv6, and ran emerge -uDNav @system @world. It reports 50 packages to rebuild, mostly network stuff, as expected, and also things like xdm, python, mplayer, qt-3...

BTW the firefox tweaks above are all documented at MozillaZine. Just google them to know what they mean. :)
Back to top
View user's profile Send private message
NathanZachary
Moderator
Moderator


Joined: 30 Jan 2007
Posts: 2605

PostPosted: Sun Oct 26, 2008 11:24 pm    Post subject: Reply with quote

Now that this issue is resolved, I just have one question about your syntax for updates. I have always done emerge -avuDN system && emerge -avuDN world. Is there some documentation on the new @ syntax? I would assume that it is not significantly different, but we both know what it means to assume. ;)
_________________
“Truth, like infinity, is to be forever approached but never reached.” --Jean Ayres (1972)
---avatar cropped from =AimanStudio---
Back to top
View user's profile Send private message
notHerbert
Advocate
Advocate


Joined: 11 Mar 2008
Posts: 2228
Location: 45N 73W

PostPosted: Sun Oct 26, 2008 11:29 pm    Post subject: Reply with quote

Ooops, I'm using portage 2.2 which uses a different syntax, but would be meaningless for < portage-2.2.

https://forums.gentoo.org/viewtopic-t-696939.html?sid=8b8ae6e397c622569547efb204aaecef


Have a good one. :P
Back to top
View user's profile Send private message
NathanZachary
Moderator
Moderator


Joined: 30 Jan 2007
Posts: 2605

PostPosted: Sun Oct 26, 2008 11:42 pm    Post subject: Reply with quote

Thanks a lot for all the help with these issues!
_________________
“Truth, like infinity, is to be forever approached but never reached.” --Jean Ayres (1972)
---avatar cropped from =AimanStudio---
Back to top
View user's profile Send private message
notHerbert
Advocate
Advocate


Joined: 11 Mar 2008
Posts: 2228
Location: 45N 73W

PostPosted: Mon Oct 27, 2008 12:12 am    Post subject: Reply with quote

My pleasure, glad to help. :D
Back to top
View user's profile Send private message
Hypnos
Advocate
Advocate


Joined: 18 Jul 2002
Posts: 2889
Location: Omnipresent

PostPosted: Mon Oct 27, 2008 3:14 am    Post subject: Reply with quote

I never had IPv6 slowness, but did have random crashes (esp. on hibernation cycles).

If you aren't using the latest kernel, that might be one thing to try.
_________________
Personal overlay | Simple backup scheme
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum