Thank you for this performance analysis. Did you already confirm that the udevadm calls are the bottleneck here? How did you do that?
The problem with skipping over any interface not listed in the Netplan configuration might be Netplan's matching logic and renaming of interfaces. We might not always know all the interfaces names that a NetplanNetDefinition matches, especially if interfaces get renamed. The netplan_netdef_match_interface() API [1] might be able to help with that (netdef._match_interface() in Python bindings). So before executing the udevadm calls, we could filter if the given interface is actually relevant. Would you be interested in working on such performance improvement as part of an upstream PR? https://github.com/canonical/netplan/pulls [1] https://netplan.readthedocs.io/en/stable/apidoc/inc- netdef/#c.netplan_netdef_match_interface ** Changed in: netplan.io (Ubuntu) Importance: Undecided => Medium ** Changed in: netplan.io (Ubuntu) Status: New => Triaged ** Also affects: netplan Importance: Undecided Status: New -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/2098831 Title: netplan apply very slow when there are many veth devices To manage notifications about this bug go to: https://bugs.launchpad.net/netplan/+bug/2098831/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs