FS#35508 - [netctl] static ip setup takes too long

Attached to Project: Arch Linux
Opened by Far Wayer (farwayer) - Monday, 27 May 2013, 19:21 GMT
Last edited by Jouke Witteveen (jouke) - Monday, 17 June 2013, 08:54 GMT
Task Type General Gripe
Category Arch Projects
Status Closed
Assigned To Jouke Witteveen (jouke)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 2
Private No

Details

Description:
Setting static IP address with netctl is too slow.

Setting IP with systemd netctl unit take about 4s. By simple systemd network unit (https://wiki.archlinux.org/index.php/Systemd/Services#Static_Ethernet_network) with several 'ip *' commands is ~150ms.


Additional info:
core/netctl 1.0-1
linux 3.9.3-1
RLT8111/8168 ethernet card
This task depends upon

Closed by  Jouke Witteveen (jouke)
Monday, 17 June 2013, 08:54 GMT
Reason for closing:  Not a bug
Additional comments about closing:  You have to wait for a carrier one way or another. If netctl waits for it, you'll see the extra time in your blame analysis. Otherwise, you just have to wait after setting an IP.
Comment by Jouke Witteveen (jouke) - Tuesday, 28 May 2013, 10:22 GMT
This is not enough information for anything. Exactly what is part is slow under which circumstances? Effectively, in the static IP case, netctl doesn't do much more than several calls to ip.
Comment by phanisvara das (phani00) - Tuesday, 28 May 2013, 11:17 GMT
setting a static IP addr. via netctl takes about 1 sec for me. the OP's 4 sec may be due to network card or driver.
Comment by Far Wayer (farwayer) - Tuesday, 28 May 2013, 20:43 GMT
Ok. I've attached some logs and systemd analyze report for netctl and simple network unit. As you can see netctl set static IP more then 30(!) times slower than simple network unit with archlinux kernel. When i switched to linux-ck kernel netctl set IP for ~2 secs. But it's still too slow in respect that it's not waiting for ethernet card hardware initialization.
If it is useful I am using only 'base' hook (not udev etc.) for generating initcpio.

Let me know if can help anything else (some logs etc.).
Comment by Jouke Witteveen (jouke) - Sunday, 16 June 2013, 08:54 GMT
This information is not very useful in finding what causes the delay in your setup. You could try adding BindsToInterfaces=() to your profile and reenable it. This suppresses the wait for the network device to become available. You break your profile by doing so, but your configuration might resemble your other network service more closely.
Comment by John (graysky) - Sunday, 16 June 2013, 12:07 GMT
jouke - No change for me here with the binding line in my profile:

Without:
% systemd-analyze blame
3.488s netctl@static.service

With:
% systemd-analyze blame
3.318s netctl@static.service
   static (0.3 KiB)
Comment by Jouke Witteveen (jouke) - Sunday, 16 June 2013, 15:24 GMT
How about adding SkipNoCarrier=yes to the profile? Really, with this little debugging information I'm just guessing.
Comment by John (graysky) - Sunday, 16 June 2013, 15:52 GMT
I will give it a shot and report back. Are you not able to configure your NIC to use a static configuration? If so, what does `systemd-alalyze blame` show for that profile?
Comment by John (graysky) - Sunday, 16 June 2013, 18:21 GMT
jouke - That did it with no negative effects that I can see at this point. Almost 10x faster.

Without:
% systemd-analyze blame
3.488s netctl@static.service

With:
% systemd-analyze blame
473 ms netctl@static.service
Comment by Jouke Witteveen (jouke) - Sunday, 16 June 2013, 20:47 GMT
Without a carrier, your network is of little use anyway, so I think there is no practical benefit in investigating any further.
If you want to see fast times in your systemd blame, you can use the SkipNoCarrier option, but your network wont be available any sooner than without it.
Comment by John (graysky) - Monday, 17 June 2013, 06:45 GMT
The SkipNoCarrier option seems to give the effect. Probably safe to close this task.

Loading...