Re: [systemd-devel] network-online.target time

2020-05-14 Thread Reindl Harald


Am 22.04.20 um 16:44 schrieb Peter Morrow:
> I'm trying to optimise our boot process and have started to look at
> the time it takes for the network to come up (a single interface to be
> routable) when using systemd-networkd:
> 
> So, here systemd-networkd-wait-online.service seems to run for 3.5s -
> I had initially though this is due to the RTT for DHCP but in doing a
> packet capture for DHCP this isn't the case:
> 
> Can anyone offer any suggestions for where I should look to try to
> speed things up here?

it *is* dhcp - it's that simple

10.587s network-up.service
9.116s  network-wan-dhcp.service

"network-wan-dhcp.service" in our case is simply started by
"network-up.service" which is a simple selfmade unit using ip-commands
and nothing else

there is no way to make that simpler as in my setup

[root@srv-rhsoft:~]$ systemctl status network-wan-dhcp.service
● network-wan-dhcp.service - Internet DHCP-Client
   Loaded: loaded (/etc/systemd/system/network-wan-dhcp.service; static;
vendor preset: disabled)
   Active: active (running) since Tue 2020-04-21 19:24:58 CEST; 21h ago
 Main PID: 1296 (dhclient)
Tasks: 1 (limit: 512)
   Memory: 4.6M
  CPU: 86ms
   CGroup: /system.slice/network-wan-dhcp.service
   └─1296 /usr/sbin/dhclient -4 -q --no-pid --request-options
subnet-mask,routers br-wan
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] network-online.target time

2020-05-06 Thread Peter Morrow
On Wed, 2020-05-06 at 17:51 +0200, Lennart Poettering wrote:
> On Mi, 06.05.20 15:50, Peter Morrow (
> peter.mor...@microsoft.com
> ) wrote:
> 
> > On Wed, 2020-05-06 at 17:39 +0200, Lennart Poettering wrote:
> > > On Mi, 22.04.20 14:44, Peter Morrow (
> > > peter.mor...@microsoft.com
> > > 
> > > ) wrote:
> > > 
> > > > Hi Folks,
> > > > 
> > > > I'm trying to optimise our boot process and have started to
> > > > look at
> > > > the time it takes for the network to come up (a single
> > > > interface to
> > > > be
> > > > routable) when using systemd-networkd:
> > > > 
> > > > Can anyone offer any suggestions for where I should look to try
> > > > to
> > > > speed things up here?
> > > 
> > > Turn on debug logging for networkd. it should tell you what it is
> > > doing, and the timestamps should allow you to determine what
> > > precisely
> > > is being waited for.
> > 
> > Thanks. Yes - I ended up doing this and it turned out much of the
> > additional time is down to ipv6 interface
> > configuration.  Specifically
> > ipv6 link local duplicate address detection.
> 
> You can turn that off if you like: IPv6DuplicateAddressDetection=

This option worked well when I tried it (total time came down to
~700ms) but unfortunately disabling it entirely isn't an option.

FWIW setting CONFIG_IPV6_OPTIMISTIC_DAD=y in the kernel is providing a
good middle ground.

Peter.


> Lennart
> 
> --
> Lennart Poettering, Berlin


___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] network-online.target time

2020-05-06 Thread Peter Morrow
On Wed, 2020-05-06 at 17:39 +0200, Lennart Poettering wrote:
> On Mi, 22.04.20 14:44, Peter Morrow (
> peter.mor...@microsoft.com
> ) wrote:
> 
> > Hi Folks,
> > 
> > I'm trying to optimise our boot process and have started to look at
> > the time it takes for the network to come up (a single interface to
> > be
> > routable) when using systemd-networkd:
> > 
> > Can anyone offer any suggestions for where I should look to try to
> > speed things up here?
> 
> Turn on debug logging for networkd. it should tell you what it is
> doing, and the timestamps should allow you to determine what
> precisely
> is being waited for.

Thanks. Yes - I ended up doing this and it turned out much of the
additional time is down to ipv6 interface configuration.  Specifically
ipv6 link local duplicate address detection.

Peter.

> 
> Lennart
> 
> --
> Lennart Poettering, Berlin
> 

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] network-online.target time

2020-05-06 Thread Lennart Poettering
On Mi, 06.05.20 15:50, Peter Morrow (peter.mor...@microsoft.com) wrote:

> On Wed, 2020-05-06 at 17:39 +0200, Lennart Poettering wrote:
> > On Mi, 22.04.20 14:44, Peter Morrow (
> > peter.mor...@microsoft.com
> > ) wrote:
> >
> > > Hi Folks,
> > >
> > > I'm trying to optimise our boot process and have started to look at
> > > the time it takes for the network to come up (a single interface to
> > > be
> > > routable) when using systemd-networkd:
> > >
> > > Can anyone offer any suggestions for where I should look to try to
> > > speed things up here?
> >
> > Turn on debug logging for networkd. it should tell you what it is
> > doing, and the timestamps should allow you to determine what
> > precisely
> > is being waited for.
>
> Thanks. Yes - I ended up doing this and it turned out much of the
> additional time is down to ipv6 interface configuration.  Specifically
> ipv6 link local duplicate address detection.

You can turn that off if you like: IPv6DuplicateAddressDetection=

Lennart

--
Lennart Poettering, Berlin
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] network-online.target time

2020-05-06 Thread Lennart Poettering
On Mi, 22.04.20 14:44, Peter Morrow (peter.mor...@microsoft.com) wrote:

> Hi Folks,
>
> I'm trying to optimise our boot process and have started to look at
> the time it takes for the network to come up (a single interface to be
> routable) when using systemd-networkd:
>
> Can anyone offer any suggestions for where I should look to try to
> speed things up here?

Turn on debug logging for networkd. it should tell you what it is
doing, and the timestamps should allow you to determine what precisely
is being waited for.

Lennart

--
Lennart Poettering, Berlin
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] network-online.target time

2020-04-22 Thread Peter Morrow
Hi Folks,

I'm trying to optimise our boot process and have started to look at
the time it takes for the network to come up (a single interface to be
routable) when using systemd-networkd:

root@HOST:/# systemd-analyze critical-chain network-online.target --no-
pager
The time after the unit is active or started is printed after the "@"
character.
The time the unit takes to start is printed after the "+" character.


network-online.target @4.144s
└─systemd-networkd-wait-online.service @615ms +3.527s
  └─systemd-networkd.service @582ms +30ms
└─systemd-tmpfiles-setup.service @315ms +63ms
  └─local-fs.target @314ms
root@HOST:/#

So, here systemd-networkd-wait-online.service seems to run for 3.5s -
I had initially though this is due to the RTT for DHCP but in doing a
packet capture for DHCP this isn't the case:

me@DHCP-SERVER:~$ sudo tshark -i eth0 -f "(ether src 28:16:a8:fd:53:77
|| ether dst 28:16:a8:fd:53:77) && (port 67 || port 68)"
Running as user "root" and group "root". This could be dangerous.
Capturing on 'eth0'
1 0.0  0.0.0.0 → 255.255.255.255 DHCP 333 DHCP
Discover - Transaction ID 0x5c9e3cd0
2 0.000157300  192.168.3.3 → 192.168.3.16 DHCP 373 DHCP Offer-
Transaction ID 0x5c9e3cd0
3 0.000695601  0.0.0.0 → 255.255.255.255 DHCP 345 DHCP Request
 - Transaction ID 0x5c9e3cd0
4 0.000771901  192.168.3.3 → 192.168.3.16 DHCP 373 DHCP ACK  -
Transaction ID 0x5c9e3cd0

So, that's 700us from discover to ack.

We have 3 network interfaces, only enP8p1s0f0np0 is of use to us:

root@HOST:/# networkctl status -a --no-pager
● 1: lo
   Link File: /usr/lib/systemd/network/99-default.link
Network File: n/a
Type: loopback
   State: carrier (unmanaged)
 Address: 127.0.0.1
  ::1


● 2: enP8p1s0f0np0
   Link File: /usr/lib/systemd/network/99-default.link
Network File: /etc/systemd/network/wired.network
Type: ether
   State: routable (configured)
Path: platform-6040.pcie-pci-0008:01:00.0
  Driver: bnxt_en
  HW Address: 28:16:a8:fd:53:77
 Address: 192.168.3.16
  2001:db8:0:1:2a16:a8ff:fefd:5377
  fe80::2a16:a8ff:fefd:5377
 Gateway: 192.168.3.1
  fe80::7683:efff:fed4:935
 DNS: 10.50.10.50
  10.50.50.50
 NTP: 10.222.184.12
Connected To: localhost on port Ethernet31/1


● 3: enP8p1s0f1np0
   Link File: /usr/lib/systemd/network/99-default.link
Network File: n/a
Type: ether
   State: off (unmanaged)
Path: platform-6040.pcie-pci-0008:01:00.1
  Driver: bnxt_en
  HW Address: 00:10:18:ad:05:01
root@HOST:/#

Networking configuration looks like this:

root@HOST:/# cat /etc/systemd/network/wired.network
[Match]
Name=eth* en*

[Network]
DHCP=v4
root@HOST:/# cat /etc/systemd/network/
blacklist_interfaces.network  wired.network
root@HOST:/# cat /etc/systemd/network/blacklist_interfaces.network
[Match]
Name=enP8p1s0f1*

[Network]
DHCP=no
LinkLocalAddressing=no
IPv6AcceptRA=false

[Link]
RequiredForOnline=no
Unmanaged=yes
root@HOST:/#

Our version is:

root@HOST:/# systemctl --version
systemd 239
+PAM +AUDIT +SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP
+LIBCRYPTSETUP -GCRYPT -GNUTLS -ACL +XZ -LZ4 -SECCOMP +BLKID -ELFUTILS
+KMOD -IDN2 -IDN -PCRE2 default-hierarchy=unified
root@HOST:/#

I've had a look at
https://github.com/systemd/systemd/blob/v239/src/network/wait-online/wait-online.c
and it really doesn't do much other than wait for the operational
state to be "routable".

Can anyone offer any suggestions for where I should look to try to
speed things up here?

Thanks!
Peter.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel