LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Why is bridge-utils slowing down ifupdown-pre.service at boot? (https://www.linuxquestions.org/questions/linux-networking-3/why-is-bridge-utils-slowing-down-ifupdown-pre-service-at-boot-4175716132/)

stoorky 08-27-2022 05:00 AM

Why is bridge-utils slowing down ifupdown-pre.service at boot?
 
Since I configured a bridged interface, I noticed that the boot went from 3-4 seconds to about 20 seconds. Here are my investigations, the ifupdown-pre.service is to blame. But why ?

Note1 : I'm on Debian 11.4
Note2 : Apart of the tests below I did several other tests, with an empty bridge (e.g. without bridge_ports), with a bridge with only a dummy0 interface, ... Same result. It seems whenever there is a bridge it slows down ifupdown-pre.service, whatever the configuration of that bridge is.

1/ Without a bridge :

Code:

$ ls /etc/network/interfaces.d/
da200-enx3448ed795fcb
   
$ cat /etc/network/interfaces.d/da200-enx3448ed795fcb
allow-hotplug enx3448ed795fcb
iface enx3448ed795fcb inet static
    address 192.168.137.2
    netmask 255.255.255.0

$ systemd-analyze blame | head -n 3
3.701s plymouth-quit-wait.service
1.698s loadcpufreq.service
1.244s postfix@-.service

$ ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
  (...)
2: wlp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
  (...)
3: enx3448ed795fcb: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN group default qlen 1000
  link/ether 34:48:ed:79:5f:cb brd ff:ff:ff:ff:ff:ff
  inet 192.168.137.2/24 brd 192.168.137.255 scope global enx3448ed795fcb
      valid_lft forever preferred_lft forever

2/ With a bridge :

My network files :

Code:

    $ ls /etc/network/interfaces.d/
    br0  da200-enx3448ed795fcb
   
    $ cat /etc/network/interfaces.d/da200-enx3448ed795fcb
    allow-hotplug enx3448ed795fcb
    iface enx3448ed795fcb inet static
        address 0.0.0.0
        netmask 0.0.0.0
   
    $ cat /etc/network/interfaces.d/br0
    auto br0
    iface br0 inet static
        address 192.168.137.2
        netmask 255.255.255.0
        bridge_ports enx3448ed795fcb
        bridge_maxwait 0
        bridge_stp off


ifupdown-pre.service` now takes 18 seconds :
Code:

    $ systemd-analyze blame | head -n 3
    17.851s ifupdown-pre.service
    2.707s plymouth-quit-wait.service
    1.946s loadcpufreq.service

    $ ip addr
    1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
        (...)
    2: wlp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
        (...)
    3: enx3448ed795fcb: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel master br0 state DOWN group default qlen 1000
        link/ether 34:48:ed:79:5f:cb brd ff:ff:ff:ff:ff:ff
    4: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
        link/ether 2e:55:46:7e:5c:1e brd ff:ff:ff:ff:ff:ff
        inet 192.168.137.2/24 brd 192.168.137.255 scope global br0
          valid_lft forever preferred_lft forever

    $ systemd-analyze critical-chain
    graphical.target @21.006s
    └─multi-user.target @21.006s
      └─plymouth-quit-wait.service @18.298s +2.707s
        └─rc-local.service @18.247s +49ms
          └─network-online.target @18.241s
            └─network.target @18.241s
              └─networking.service @18.173s +67ms
                └─ifupdown-pre.service @321ms +17.851s
                  └─systemd-udev-trigger.service @251ms +68ms
                    └─systemd-udevd-kernel.socket @244ms
                      └─system.slice @185ms
                        └─-.slice @185ms

    # journalctl -b -u ifupdown-pre.service
    22 -- Journal begins at Tue 2022-07-12 21:45:01 WAT, ends at Sat 2022-08-27 09:26:02 WAT. --
    23 août 27 09:25:00 xps13-7390 systemd[1]: Starting Helper to synchronize boot up for ifupdown...
    24 août 27 09:25:00 xps13-7390 sh[347]: ifquery: parsing file /etc/network/interfaces.d/br0
    25 août 27 09:25:00 xps13-7390 sh[347]: ifquery: parsing file /etc/network/interfaces.d/da200-enx3448ed795fcb
    26 août 27 09:25:18 xps13-7390 systemd[1]: Finished Helper to synchronize boot up for ifupdown.



All times are GMT -5. The time now is 06:01 AM.