Ask HN: Since yesterday, Firefox and Thunderbird take 30s to start. Why?
Both FF and Thunderbird suddenly take 30s to start on my linux machine.
"firefox -safe-mode" does no speed it up.
When I run "strace firefox", the first time it hangs after this line:
restart_syscall(<... resuming interrupted poll ...>
Then it hangs multiple times after lines after lines that all contain the word "poll" in one form or another.
What does the combined Linux expertise of HN say? How do I debug this situation?
12 comments
[ 2.4 ms ] story [ 48.6 ms ] threadYou can also try starting from cli and set the logging level
Looking at my versions I'm behind on firefox but thunderbird is up to date. Both start in under a second. Are you using the snap distributions? Also try disabling any extensions first before delving deeper.I think -safe-mode disables all extensions. No snap, just FF.
Amazingly, it even happens when I install a fresh version of FF in a docker container!
Maybe some update hit that is doing some funky network stuff that is slow via my router or something?
Hmm... FF starts immediately if I disconnect from the network first. That seems to support the last idea.
Seems to be some kind of DNS issue. When I replace my /etc/resolv.conf file with a file that contains only this:
The delay goes away.Before there was also:
No idea what 127.0.0.53 is. Is there a DNS server running on my laptop? And also not sure what "search" does.Search specifies one or more domains, for instance ‘domain1.com’, and then if a program tries to resolve ‘host1’ if that doesn’t work it’ll also try ‘host1.domain1.com’.
That way you can give your router for instance the host name router.domain1.com and it’ll work if you type ‘ping router’.
And which dns server does the proxy dns server connect to?
The earlier solution was dhcp clients editing resolv.conf to include the configuration they get from the dhcp server. But that doesn’t really work if it changes all the time, if you want to have a different manual configuration for some networks or if you are connected to multiple networks at the same time.
Systemd tries to make it possible to configure this in a modern way and the idea is that most applications (that use the system libraries in the typical way) don’t use resolv.conf at all but talk to a part of systemd to resolve queries with that part using modern configuration. Other legacy applications that try to parse that file or use the configuration in another way find a proxy dns server run by systemd that gives them the same answers the other applications get.
Try tcpdump, see what happens around that time?
Your computer is too slow.
It seems Firefox contacts <myhostname>.<hostnameofmyrouter> and that hangs.
Why does FF do that? Can I disable it?
For now, I put this into /etc/hosts:
0.0.0.0 <myhostname>.<hostnameofmyrouter>
Now Firefox and Thunderbird start fast again.