<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <br>
    <div class="moz-cite-prefix">On 04-Aug-22 15:51,
      <a class="moz-txt-link-abbreviated" href="mailto:dhcp-users-request@lists.isc.org">dhcp-users-request@lists.isc.org</a> wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:mailman.1176.1659642676.56945.dhcp-users@lists.isc.org">
      <pre class="moz-quote-pre" wrap="">Date: Thu, 4 Aug 2022 12:05:46 -0700
From: "Greg Sloop <a class="moz-txt-link-rfc2396E" href="mailto:gregs@sloop.net" moz-do-not-send="true"><gregs@sloop.net></a>" <a class="moz-txt-link-rfc2396E" href="mailto:gregs@sloop.net" moz-do-not-send="true"><gregs@sloop.net></a>
To: Users of ISC DHCP <a class="moz-txt-link-rfc2396E" href="mailto:dhcp-users@lists.isc.org" moz-do-not-send="true"><dhcp-users@lists.isc.org></a>
Subject: Re: extremely slow DHCPD startup time
Message-ID:
        <a class="moz-txt-link-rfc2396E" href="mailto:CAAjorqX9EnKdwW=3gO3VycX_tVQTHF4je1aYrRdc+8BOXyEdjQ@mail.gmail.com" moz-do-not-send="true"><CAAjorqX9EnKdwW=3gO3VycX_tVQTHF4je1aYrRdc+8BOXyEdjQ@mail.gmail.com></a>
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.)
</pre>
    </blockquote>
    <p>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.</p>
    <p>Writes will be limited to the speed of the real disk, but reads
      (thus startup) will go at RAM disk speeds.<br>
    </p>
    <p>Startup/shutdown needs to create/remove the RAM disk.</p>
    <p><a moz-do-not-send="true"
href="https://www.howtoforge.com/hybrid-raid_1-mirror-of-ram-drive-and-sata-hdd-using-lvm-with-luks-and-systemd-on-fedora-linux"
        class="moz-txt-link-freetext">https://www.howtoforge.com/hybrid-raid_1-mirror-of-ram-drive-and-sata-hdd-using-lvm-with-luks-and-systemd-on-fedora-linux</a>
      has a basic example (near the end).  <br>
    </p>
    <p>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.<br>
    </p>
    <p>tmpfs can be used instead of the RAM disk.</p>
    <p>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.</p>
    <p>Don't forget to allocate enough space for both leases and leases~
      in the partition & RAMdisk.</p>
    <p><br>
    </p>
    <pre class="moz-signature" cols="72">Timothe Litt
ACM Distinguished Engineer
--------------------------
This communication may not represent the ACM or my employer's views,
if any, on the matters discussed. 
</pre>
    <p><br>
    </p>
    <p>
    </p>
  </body>
</html>