You are not logged in.

#1 2013-02-22 14:09:38

xiliyi
Member
Registered: 2011-05-14
Posts: 57

[solved]Applications start slowly when PC is connected to the Internet

Hi forums,

I’m running arch x64 on a thinkpad x201. I just moved to a place where I have Internet access via WiFi, but don’t know the technical details behind it (what router, provider…).
I connect to the Internet manually using netcfg and the saved WiFi profile. After booting but before connecting to the Internet, applications start instantly when I launch them. After connecting to the Internet, it takes about 20 seconds for them to start. When I disconnect from the WiFi, they fire up instantly again. I observed this behaviour with firefox, libreoffice and mpd, but it may occur with other applications as well.
Also, when I start firefox and try to open the first website, it takes about 40 seconds until anything happens. After that initial delay, websites load very quickly until I close firefox and relaunch it (then it takes about 40 seconds again for the first site, and so on). Before I moved here, everything was working just fine.
Other applications that require a working internet connection (like offlineimap, ping…) work instantly after I connect to the WiFi and don’t show any signs of delay.

I’m not quite sure whether this should be posted in “applications” or “networking”, but I’d appreciate help!

Thanks
Xi Liyi

Last edited by xiliyi (2013-02-23 11:54:37)

Offline

#2 2013-02-22 17:04:19

Leonid.I
Member
From: Aethyr
Registered: 2009-03-22
Posts: 999

Re: [solved]Applications start slowly when PC is connected to the Internet

Please post your /etc/nsswitch.conf and /etc/hosts.


Arch Linux is more than just GNU/Linux -- it's an adventure
pkill -9 systemd

Offline

#3 2013-02-22 17:29:47

xiliyi
Member
Registered: 2011-05-14
Posts: 57

Re: [solved]Applications start slowly when PC is connected to the Internet

# Begin /etc/nsswitch.conf

passwd: files
group: files
shadow: files

publickey: files

hosts: files dns myhostname
networks: files

protocols: files
services: files
ethers: files
rpc: files

netgroup: files

# End /etc/nsswitch.conf
#
# /etc/hosts: static lookup table for host names
#

#<ip-address>   <hostname.domain.org>   <hostname>
127.0.0.1       localhost.localdomain   localhost
::1             localhost.localdomain   localhost

# End of file

Offline

#4 2013-02-22 18:20:56

Leonid.I
Member
From: Aethyr
Registered: 2009-03-22
Posts: 999

Re: [solved]Applications start slowly when PC is connected to the Internet

Does putting 'dns' after 'myhostname' help?


Arch Linux is more than just GNU/Linux -- it's an adventure
pkill -9 systemd

Offline

#5 2013-02-23 03:28:23

xiliyi
Member
Registered: 2011-05-14
Posts: 57

Re: [solved]Applications start slowly when PC is connected to the Internet

It solved the problem! Thanks for the answer. I wouldn’t know why this affects libreoffice, but it does.
Could you explain in three words why dns needs to be put after myhostname, so I can understand and learn for the next time?

Anyway, thanks a lot!

Offline

#6 2013-02-24 18:55:01

Leonid.I
Member
From: Aethyr
Registered: 2009-03-22
Posts: 999

Re: [solved]Applications start slowly when PC is connected to the Internet

xiliyi wrote:

It solved the problem! Thanks for the answer. I wouldn’t know why this affects libreoffice, but it does.
Could you explain in three words why dns needs to be put after myhostname, so I can understand and learn for the next time?

Anyway, thanks a lot!

Please see this thread https://mailman.archlinux.org/pipermail … 23857.html ... Basically, the problem is that various applications try to resolve your hostname, reach a timeout due to whatever reason and fall back to /etc/hostname; "myhostname" tells libnsswitch to use locally configured hostname directly. This is OK for a laptop, but will probably lead to issues if come of services rely on a resolvable hostname...

Last edited by Leonid.I (2013-02-24 18:57:30)


Arch Linux is more than just GNU/Linux -- it's an adventure
pkill -9 systemd

Offline

Board footer

Powered by FluxBB