Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Firefox 3.0.5 slow to startup [SOLVED]
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
LazyHeifer
n00b
n00b


Joined: 29 Mar 2005
Posts: 39
Location: NY , USA

PostPosted: Sat Dec 27, 2008 6:35 pm    Post subject: Firefox 3.0.5 slow to startup [SOLVED] Reply with quote

Recently installed 64bit Gentoo on my Thinkpad R60e. Core 2 T5500 chip. 2GB of RAM.

The laptop had 32bit Gentoo on it for the last few years, had the itch to try out 64bit and see if it was still as bad as it was 3 yrs ago .. 8) .

All seems well, only (minor) problem is that Firefox 3 takes approx 12 seconds to start, from an idle desktop. It is a completely fresh load ... kdelibs, kdebase, kdeadmin (3.5.9) (and their dependencies) are the only apps installed on the machine. (haven't finished loading it up yet.) . Also, after closing firefox, restarting firefox takes almost 9 seconds ... when that should be almost instantaneous.

Useful parts of /etc/make.conf :
Code:


USE="X aac acpi alsa branding cddb cdr css custom-cpuopts custom-optimization dbus divx dvd dvdr dvdread encode ffmpeg firefox firefox3 flac gif glitz hal ibmacpi imlib imlib2 java jpeg jpeg2k kde lame laptop madwifi mmx mozilla      moznopango mp2 mp3 mp4 nsplugin ogg opengl png qt3 qt4 qtdesigner radio sdl smapi spell sqlite sqlite3 sse sse2 sse3 ssse3 svg theora tiff truetype twolame vcd vorbis win32codecs wmp x264 xcb xcomposite xulrunner xvid -arts -bindist -esd -gnome -gtk -ipv6 -kerberos -oss -xscreensaver"

CFLAGS="-O2 -march=nocona -pipe -fomit-frame-pointer"
CHOST="x86_64-pc-linux-gnu"
#CFLAGS="-O2 -march=prescott -pipe -fomit-frame-pointer"
#CHOST="i686-pc-linux-gnu"
CXXFLAGS="${CFLAGS}"



Firefox was emerged with
Code:
USE="dbus java xulrunner -bindist -custom-optimization -gnome -iceweasel -ipv6 -mozdevelop -restrict-javascript -startup-notification"


When I start firefox from a terminal (hoping for clues to the slowness), there is no ouput during startup, just a 12 second pause, and then the firefox gui fires up.

Is there any app I can run to 'trace' firefox while it is starting and determine where the bottleneck is? In 32bit Gentoo and on all other OS'es that I have used, firefox starts up in approx 4 seconds, and restarts are in a blink of an eye.
_________________
Throw off those chains of reason, and your prison disappears.


Last edited by LazyHeifer on Sun Dec 28, 2008 2:19 am; edited 3 times in total
Back to top
View user's profile Send private message
d2_racing
Bodhisattva
Bodhisattva


Joined: 25 Apr 2005
Posts: 13047
Location: Ste-Foy,Canada

PostPosted: Sat Dec 27, 2008 6:37 pm    Post subject: Reply with quote

What happens when you run this :

Code:

$ firefox -safe-mode
Back to top
View user's profile Send private message
LazyHeifer
n00b
n00b


Joined: 29 Mar 2005
Posts: 39
Location: NY , USA

PostPosted: Sat Dec 27, 2008 6:43 pm    Post subject: Reply with quote

Damn you and your quickness !! :D
I forgot to add that
Code:
 
firefox -safe-mode

produces the same effect.

Still a 12 sec start, and a 9 sec restart. Obviously not a rouge extension issue.
_________________
Throw off those chains of reason, and your prison disappears.
Back to top
View user's profile Send private message
platojones
Veteran
Veteran


Joined: 23 Oct 2002
Posts: 1602
Location: Just over the horizon

PostPosted: Sat Dec 27, 2008 7:03 pm    Post subject: Reply with quote

It sort of sounds like you are a victim of the FF 3 'Awesome Bar' slowdown...which many people find to be a dubious feature...but it definitely slows down FF 3 startup and shutdown. Try this to see if it helps...go to about:config, locate the browser.urlbar.maxRichResults setting and change the value from 12 to 0. That should help.
Back to top
View user's profile Send private message
LazyHeifer
n00b
n00b


Joined: 29 Mar 2005
Posts: 39
Location: NY , USA

PostPosted: Sat Dec 27, 2008 7:13 pm    Post subject: Reply with quote

Done, with no change in startup time. Good thought, though.

Also installed 'oldbar' extension after setting that to '0'. *cough* stupid awesome bar *cough*
_________________
Throw off those chains of reason, and your prison disappears.
Back to top
View user's profile Send private message
platojones
Veteran
Veteran


Joined: 23 Oct 2002
Posts: 1602
Location: Just over the horizon

PostPosted: Sat Dec 27, 2008 7:20 pm    Post subject: Reply with quote

LazyHeifer wrote:
Done, with no change in startup time. Good thought, though.

Also installed 'oldbar' extension after setting that to '0'. *cough* stupid awesome bar *cough*


Ok, well, cross that one off the list. You asked in your orignal post if there was a tool to trace firefox as it runs...have you tried strace? It will show you all of the syscalls made while running and should show you where there bottleneck is...of course, be ready for tons of output in your terminal, but at least you can see what it's trying to do during those 12 seconds.
Back to top
View user's profile Send private message
LazyHeifer
n00b
n00b


Joined: 29 Mar 2005
Posts: 39
Location: NY , USA

PostPosted: Sat Dec 27, 2008 7:40 pm    Post subject: Reply with quote

roger that. Will emerge strace and figure out how to use it ... done.

arknapp@MobileHeifer ~ $ strace -c firefox
% time seconds usecs/call calls errors syscall
------ ----------- ----------- --------- --------- ----------------
30.01 3.599763 739 4870 2141 read
18.22 2.185661 795 2749 select
11.57 1.387207 775 1791 849 access
9.37 1.124270 795 1415 writev
2.09 0.250106 799 313 mprotect
......
5.69 0.682169 774 881 290 open
3.72 0.445603 687 649 lseek
3.57 0.428667 722 594 close
2.97 0.356809 761 469 25 stat
2.09 0.250757 796 315 mmap
.......
1.92 0.230112 735 313 24 futex
1.81 0.216929 751 289 fstat
1.44 0.172545 583 296 fcntl
1.19 0.143259 762 188 brk
1.03 0.123452 739 167 poll

------ ----------- ----------- --------- --------- ----------------
100.00 11.993612 15918 3349 total

Guess I wasn't too far off with that 12 sec thing (strace shows 11.993612) :)

I removed the items that seemed to take less than .01 sec and left the 'larger' ones. Any thots ??

Also, it appears to have large amounts of read and access errors.

Code:

30.01    3.599763         739      4870     2141 read
11.57    1.387207         775      1791      849  access


On another note, I emerge gxine to grab a gtk2 app to see if it also fires up slower than normal, but that gtk2 app fired up in less than a second on my KDE desktop.
_________________
Throw off those chains of reason, and your prison disappears.
Back to top
View user's profile Send private message
platojones
Veteran
Veteran


Joined: 23 Oct 2002
Posts: 1602
Location: Just over the horizon

PostPosted: Sat Dec 27, 2008 9:43 pm    Post subject: Reply with quote

Nothing jumps out from that, except it spends about half of that 12 seconds in reads/accesses...the read/access errors seem normal..it's reading a lot of things (files, sockets, etc.), that may not be there. Also, I don't know if you tried strace without the '-c' flag, but if you did, were there any calls that just seemed to hang for a second or 2? Do you notice a lot of disk activity during the 12 seconds when it's starting up? Reason I ask...it may point to file access or network access as the bottleneck.
Back to top
View user's profile Send private message
LazyHeifer
n00b
n00b


Joined: 29 Mar 2005
Posts: 39
Location: NY , USA

PostPosted: Sat Dec 27, 2008 11:39 pm    Post subject: Reply with quote

Thanks for the suggestions so far ... strace output without the -c flag shows that it is hanging at two sequential spots ... looks like it is timing out waiting for something ... here is the dump nearest the pause .. these two 'timeouts' easily account for over half of the 12 second startup.
Code:

mprotect(0x7fc1fc6a0000, 4096, PROT_READ) = 0
mprotect(0x7fc1fc8a7000, 4096, PROT_READ) = 0
munmap(0x7fc206efb000, 98488)           = 0
stat("/etc/resolv.conf", {st_mode=S_IFREG|0644, st_size=174, ...}) = 0
open("/etc/resolv.conf", O_RDONLY)      = 7
fstat(7, {st_mode=S_IFREG|0644, st_size=174, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fc206f29000
read(7, "# Generated by dhcpcd from wlan0\n"..., 4096) = 174
read(7, ""..., 4096)                    = 0
close(7)                                = 0
munmap(0x7fc206f29000, 4096)            = 0
socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 7
connect(7, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("192.168.254.254")}, 28) = 0
fcntl(7, F_GETFL)                       = 0x2 (flags O_RDWR)
fcntl(7, F_SETFL, O_RDWR|O_NONBLOCK)    = 0

poll([{fd=7, events=POLLOUT}], 1, 0)    = 1 ([{fd=7, revents=POLLOUT}])
sendto(7, "\375+\1\0\0\1\0\0\0\0\0\0\fMobileHeifer\6domain\7"..., 45, MSG_NOSIGNAL, NULL, 0) = 45
poll([{fd=7, events=POLLIN}], 1, 5000)  = 0 (Timeout)

poll([{fd=7, events=POLLOUT}], 1, 0)    = 1 ([{fd=7, revents=POLLOUT}])
sendto(7, "\375+\1\0\0\1\0\0\0\0\0\0\fMobileHeifer\6domain\7"..., 45, MSG_NOSIGNAL, NULL, 0) = 45
poll([{fd=7, events=POLLIN}], 1, 5000)  = 0 (Timeout)



MobileHeifer is the hostname of the Thinkpad, and 192.168.254.254 is the IP of the router inside the LAN.
_________________
Throw off those chains of reason, and your prison disappears.
Back to top
View user's profile Send private message
d2_racing
Bodhisattva
Bodhisattva


Joined: 25 Apr 2005
Posts: 13047
Location: Ste-Foy,Canada

PostPosted: Sat Dec 27, 2008 11:48 pm    Post subject: Reply with quote

LazyHeifer wrote:
Damn you and your quickness !! :D


I'm here to help :P
Back to top
View user's profile Send private message
niick
Tux's lil' helper
Tux's lil' helper


Joined: 09 Mar 2006
Posts: 93

PostPosted: Sun Dec 28, 2008 12:10 am    Post subject: Reply with quote

Over in "Documentation, Tips & Tricks" there is a great tip to speed up firefox, it is here. I know this doesn't really solve your problem, but it improves the speed of firefox a lot. It now starts up super quick and switches tabs fast too, in short the improvement is substantial.

Hope this helps.
Back to top
View user's profile Send private message
platojones
Veteran
Veteran


Joined: 23 Oct 2002
Posts: 1602
Location: Just over the horizon

PostPosted: Sun Dec 28, 2008 12:31 am    Post subject: Reply with quote

LazyHeifer wrote:
Thanks for the suggestions so far ... strace output without the -c flag shows that it is hanging at two sequential spots ... looks like it is timing out waiting for something ... here is the dump nearest the pause .. these two 'timeouts' easily account for over half of the 12 second startup.
Code:

mprotect(0x7fc1fc6a0000, 4096, PROT_READ) = 0
mprotect(0x7fc1fc8a7000, 4096, PROT_READ) = 0
munmap(0x7fc206efb000, 98488)           = 0
stat("/etc/resolv.conf", {st_mode=S_IFREG|0644, st_size=174, ...}) = 0
open("/etc/resolv.conf", O_RDONLY)      = 7
fstat(7, {st_mode=S_IFREG|0644, st_size=174, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fc206f29000
read(7, "# Generated by dhcpcd from wlan0\n"..., 4096) = 174
read(7, ""..., 4096)                    = 0
close(7)                                = 0
munmap(0x7fc206f29000, 4096)            = 0
socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 7
connect(7, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("192.168.254.254")}, 28) = 0
fcntl(7, F_GETFL)                       = 0x2 (flags O_RDWR)
fcntl(7, F_SETFL, O_RDWR|O_NONBLOCK)    = 0

poll([{fd=7, events=POLLOUT}], 1, 0)    = 1 ([{fd=7, revents=POLLOUT}])
sendto(7, "\375+\1\0\0\1\0\0\0\0\0\0\fMobileHeifer\6domain\7"..., 45, MSG_NOSIGNAL, NULL, 0) = 45
poll([{fd=7, events=POLLIN}], 1, 5000)  = 0 (Timeout)

poll([{fd=7, events=POLLOUT}], 1, 0)    = 1 ([{fd=7, revents=POLLOUT}])
sendto(7, "\375+\1\0\0\1\0\0\0\0\0\0\fMobileHeifer\6domain\7"..., 45, MSG_NOSIGNAL, NULL, 0) = 45
poll([{fd=7, events=POLLIN}], 1, 5000)  = 0 (Timeout)



MobileHeifer is the hostname of the Thinkpad, and 192.168.254.254 is the IP of the router inside the LAN.


Yeah, that's network...unless you are running over IPV6, you may want to disable it in firefox...I'm not 100% sure, but it looks like it's performing a check for IPV6 DNS, timing out, then moving on...

Try going into about:config and turning network.dns.disableIPv6 to true....but it's hanging tring to connect to a domain socket...which looks like it may be IPV6 related.
Back to top
View user's profile Send private message
LazyHeifer
n00b
n00b


Joined: 29 Mar 2005
Posts: 39
Location: NY , USA

PostPosted: Sun Dec 28, 2008 12:32 am    Post subject: Reply with quote

I implemented all but mounting FF in tmpfs. I don't think that is my problem, but it does look like an interesting trick. The strace dump seems to point to some network issue (with the two timeouts listed in the dump) ... I don't think that mounting it on tmpfs will solve that ..

Also , I turned off IPV6 in FF

Code:

network.dns.disableIPv6 ; true


and deactivated IPv6 in Gentoo (/etc/modules.d/aliases)
Code:

alias net-pf-10       off     # IPv6
alias ipv6              off     # IPv6


as a possible fix, but to no avail.

EDIT : platojones , looks like we were posting at the same time .. 8) ... and thinking about the same thing.
_________________
Throw off those chains of reason, and your prison disappears.
Back to top
View user's profile Send private message
platojones
Veteran
Veteran


Joined: 23 Oct 2002
Posts: 1602
Location: Just over the horizon

PostPosted: Sun Dec 28, 2008 12:37 am    Post subject: Reply with quote

It's funny, there are 2 thread that seem similar...I'm commenting on both, and nothing seems to be helping...the other one is here: https://forums.gentoo.org/viewtopic-t-721688-highlight-.html

Ok, could you try another DNS server then...you are getting a network timeout on startup...maybe it is just a slow DNS server you are connecting to. Firefox tries to connect before the UI even comes up...perhaps as part of it's process for checking if updates are available.
Back to top
View user's profile Send private message
LazyHeifer
n00b
n00b


Joined: 29 Mar 2005
Posts: 39
Location: NY , USA

PostPosted: Sun Dec 28, 2008 12:44 am    Post subject: Reply with quote

ha :) As yet another attempt, I switched my dns servers in the router to some OpenDNS servers. No change.

I wonder if I change it in Gentoo instead ....
_________________
Throw off those chains of reason, and your prison disappears.
Back to top
View user's profile Send private message
LazyHeifer
n00b
n00b


Joined: 29 Mar 2005
Posts: 39
Location: NY , USA

PostPosted: Sun Dec 28, 2008 12:57 am    Post subject: Reply with quote

Solved.

Replaced existing /etc/resolv.conf
Code:

# Generated by dhcpcd from wlan0
# /etc/resolv.conf.head can replace this line
search domain.invalid
nameserver 192.168.254.254
# /etc/resolv.conf.tail can replace this line


with my ISP's Primary DNS server
Code:

# Generated by dhcpcd from wlan0
# /etc/resolv.conf.head can replace this line
#search domain.invalid
#nameserver 192.168.254.254
nameserver      66.133.170.2
# /etc/resolv.conf.tail can replace this line


and all is back to normal. Startup from a reboot and idle desktop is approx 4 sec , and a restart of a recently closed firefox is approx 1 - 2 sec.

Thanks to all for their helpful suggestions and patience.
_________________
Throw off those chains of reason, and your prison disappears.
Back to top
View user's profile Send private message
LazyHeifer
n00b
n00b


Joined: 29 Mar 2005
Posts: 39
Location: NY , USA

PostPosted: Sun Dec 28, 2008 1:25 am    Post subject: Reply with quote

Not solved.

/etc/resolv.conf will get overwritten by dhcpcd at each new dhcp lease. hmm.
_________________
Throw off those chains of reason, and your prison disappears.
Back to top
View user's profile Send private message
platojones
Veteran
Veteran


Joined: 23 Oct 2002
Posts: 1602
Location: Just over the horizon

PostPosted: Sun Dec 28, 2008 1:43 am    Post subject: Reply with quote

LazyHeifer wrote:
Not solved.

/etc/resolv.conf will get overwritten by dhcpcd at each new dhcp lease. hmm.


There's a setting to turn that off in dhcp...
Back to top
View user's profile Send private message
LazyHeifer
n00b
n00b


Joined: 29 Mar 2005
Posts: 39
Location: NY , USA

PostPosted: Sun Dec 28, 2008 1:53 am    Post subject: Reply with quote

bloody hell, what is up with the 'too many connections' here in the forums.

Anyway, I remember that there is a way to stop overwriting /etc/resolv.conf, but I cant remember it , and it seems better to fix it in /etc/conf.d/net anyway. I set the dns in /etc/conf.d/net to the ISP's DNS servers, and it seems to work fine now, after multiple reboots. I am not liking this as a solution, it should not be necessary, but it is working ...

Code:

modules=( "iwconfig" )

config_eth0=( "dhcp" )
dhcp_eth0="nodns nontp nonis"

essid_wlan0="teh_borg"
channel_wlan0="6"
config_teh_borg=( "192.168.254.115/24 brd 192.168.255.0" )
routes_teh_borg=( "default via 192.168.254.254" )
dns_servers_teh_borg=( "66.133.170.2" "170.215.255.114" )

#config_wlan0=( "dhcp" )
#dhcp_wlan0="nontp nonis"

_________________
Throw off those chains of reason, and your prison disappears.
Back to top
View user's profile Send private message
platojones
Veteran
Veteran


Joined: 23 Oct 2002
Posts: 1602
Location: Just over the horizon

PostPosted: Sun Dec 28, 2008 2:01 am    Post subject: Reply with quote

that's it actually...what's not to like :-)
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
Page 1 of 1

 
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