Re: extremely slow DHCPD startup time

Timothe Litt <[email protected]> Thu, 4 Aug 2022 19:54:38 -0400
Newsgroups gmane.network.dhcp.isc.dhcp-client
Message-ID <[email protected]>
On 04-Aug-22 15:51, [email protected] wrote:
> Date: Thu, 4 Aug 2022 12:05:46 -0700
> From: "Greg Sloop<[email protected]>"<[email protected]>
> To: Users of ISC DHCP<[email protected]>
> Subject: Re: extremely slow DHCPD startup time
> Message-ID:
> 	<CAAjorqX9EnKdwW=3gO3VycX_tVQTHF4je1aYrRdc+8BOXyEdjQ@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.

-- 
ISC funds the development of this software with paid support subscriptions. Contact us at https://www.isc.org/contact/ for more information.

dhcp-users mailing list
[email protected]
https://lists.isc.org/mailman/listinfo/dhcp-users
OpenPGP_signature (application/pgp-signature, 495 B) - not displayed