Increased daemon startup time after combining subnets

Simon Hobson dhcp1 at
Fri Apr 5 09:33:13 UTC 2019

Akey, Michael <Mike.Akey at> wrote:

> After combining 4 subnet statements into one monolithic subnet statement our DHCP servers take more than double the time to process the leases database file on startup (from about 1 minute to over 3).  These subnets were already quite large /17's but combined make a single /15.  Normally we wouldn't make a subnet and pool that large but the usual rules don't apply to this network - it's for wireless clients and broadcast traffic is limited by network gear.
> Having little knowledge of how dhcpd handles the leases file on startup, I assumed that merely combining these four subnets and pools into one single subnet and pool would have little effect on the operation of dhcpd.  I'm not adding any significant about of potential leases, so what is causing the additional startup time?  Any ideas?

That does seem odd - as you say, there's very little difference in the size of the pool.

AIUI from previous comments in here (I'm not a dev, so the code means very little to me), internally the server keeps a structure for all potential leases - that's an entry for every IP that falls within a defined pool/range regardless of whether it actually appears in the leases file. Access into the structure is via a hashing function - so that's one potential area to look at, I vaguely recall comments that this can become inefficient unless adjusted for large pools.
Then the leases file is read in, with each entry being used to update the in-memory storage.

Since AIUI there is only one leases structure, it's hard to see why having all the addresses in one pool vs 4 pools of the same total size should make such a difference. I assume this is consistent and not just a "one off as it converts stuff" issue ?

That is for a single server - you are running failover. I wonder if there's a difference between processing one big pool vs 4 smaller ones with failover. You could easily test that by going back to your 4 separate pools while keeping the same subnet - you can have multiple pools/ranges, each with a separate failover statement, per subnet.

More information about the dhcp-users mailing list