dhcp issueshttps://gitlab.isc.org/isc-projects/dhcp/-/issues2020-08-07T16:05:04Zhttps://gitlab.isc.org/isc-projects/dhcp/-/issues/125Server startup slow under BSD with many interfaces2020-08-07T16:05:04ZNick RogersServer startup slow under BSD with many interfaces---
name: dhcpd startup is terribly slow under BSD with hundreds or thousands of interfaces
about: the startup is slow because getifaddrs() is walked for all interfaces O(n^2)
---
**Describe the bug**
When running dhcpd under FreeBSD, ...---
name: dhcpd startup is terribly slow under BSD with hundreds or thousands of interfaces
about: the startup is slow because getifaddrs() is walked for all interfaces O(n^2)
---
**Describe the bug**
When running dhcpd under FreeBSD, bpf.c relies on getifaddrs() to determine the MAC address of each interface. getifaddrs() ends up being iterated entirely for each interface, yielding O(n^2) performance. This is not that big of a deal until you have hundreds or thousands of interfaces (e.g. VLANs) and the restart takes too long (30seconds) for a production network.
**To Reproduce**
Steps to reproduce the behavior:
1. Run dhcpd on thousands of interfaces
**Expected behavior**
The startup time is very slow until the daemon responds on BPFs
**Environment:**
- ISC DHCP version: 4.4.2
- OS: FreeBSD 12.1 from FBSD ports
- Standard net/isc-dhcp44-server port4.5.0-beta