extremely slow DHCPD startup time

Timothe Litt litt at acm.org
Thu Aug 4 23:54:38 UTC 2022


On 04-Aug-22 15:51, dhcp-users-request at lists.isc.org wrote:
> Date: Thu, 4 Aug 2022 12:05:46 -0700
> From: "Greg Sloop<gregs at sloop.net>"<gregs at sloop.net>
> To: Users of ISC DHCP<dhcp-users at lists.isc.org>
> Subject: Re: extremely slow DHCPD startup time
> Message-ID:
> 	<CAAjorqX9EnKdwW=3gO3VycX_tVQTHF4je1aYrRdc+8BOXyEdjQ at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> I'm sure others will have some useful suggestions - but I do know that
> improving disk I/O can seriously improve performance.
> I'm not sure if that will improve restart/start/reload times.
>
> It would be pretty easy to test though, say swapping for an SSD/Nvme.
> (Or if you like living dangerously, putting the disk in RAM.)

To live less dangerously, create a partition for your lease file on a 
real disk.  lvm or mdadm mirror (RAID 1) it with a RAM disk, and set the 
real disk to -writemostly (lvm) / -W (mdadm.

Writes will be limited to the speed of the real disk, but reads (thus 
startup) will go at RAM disk speeds.

Startup/shutdown needs to create/remove the RAM disk.

https://www.howtoforge.com/hybrid-raid_1-mirror-of-ram-drive-and-sata-hdd-using-lvm-with-luks-and-systemd-on-fedora-linux 
has a basic example (near the end).

For system boot, you can make dhcpd start after the RAM disk is 
initialized and mirror copy is complete or you can have the initial 
dhcpd startup run from the real disk and let the mirror catch up.  The 
former is probably faster (the real disk will be read only by the mirror 
copy), but you should benchmark it since YMMV.

tmpfs can be used instead of the RAM disk.

You should also make sure that dhcpd's ulimits (and system memory) 
suffice to avoid pagefaults/swapping while dhcpd is building its 
in-memory structures from the leases file.

Don't forget to allocate enough space for both leases and leases~ in the 
partition & RAMdisk.


Timothe Litt
ACM Distinguished Engineer
--------------------------
This communication may not represent the ACM or my employer's views,
if any, on the matters discussed.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/dhcp-users/attachments/20220804/49af3407/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 495 bytes
Desc: OpenPGP digital signature
URL: <https://lists.isc.org/pipermail/dhcp-users/attachments/20220804/49af3407/attachment-0001.sig>


More information about the dhcp-users mailing list