<div dir="ltr">Hi Simon Thanks for reply,<div> Periodically, default is every hour, the server will write out a fresh leases file from it's internal structures  ---><br>I have a doubt when the server

write out a fresh leases file from it's internal structures will the dhcpd service be in off state at this duration?</div><div><br></div><div>this file will contain no duplicate entries ---><br>Hi I have seen the duplicate entry in my server lease file<br> sample  snippet:<br>==============</div><div>lease <b>192.168.2.52</b> {<br><b>  starts 5 2019/09/27 07:21:32;<br>  ends 5 2019/09/27 08:21:32;</b><br>  tstp 5 2019/09/27 08:51:32;<br>  tsfp 5 2019/09/27 08:21:32;<br>  cltt 5 2019/09/27 07:21:32;<br> <b> binding state active;</b><br>  next binding state expired;<br>  hardware ethernet 70:bb:e9:37:d9:9e;<br>  uid "\001p\273\3517\331\236";<br>  set vendor-class-identifier = "android-dhcp-9";<br>  client-hostname "RedmiNote6Pro";<br>}<br>lease <b>192.168.2.52</b> {<br> <b> starts 5 2019/09/27 07:21:32;<br>  ends 5 2019/09/27 08:21:32;</b><br>  tstp 5 2019/09/27 08:51:32;<br>  tsfp 5 2019/09/27 08:51:32;<br>  atsfp 5 2019/09/27 08:51:32;<br>  cltt 5 2019/09/27 07:21:32;<br>  <b>binding state active;</b><br>  next binding state expired;<br>  hardware ethernet 70:bb:e9:37:d9:9e;<br>  uid "\001p\273\3517\331\236";<br>  set vendor-class-identifier = "android-dhcp-9";<br>  client-hostname "RedmiNote6Pro";<br>}<br></div><div>Yes It has same data, I don't see any issue on client side  but want to make sure that, Is this acceptable in lease file ?</div><div>or do we need to add any parameter in the config to avoid such duplicates in lease file?</div><div><br></div><div>Thanks in Advance.</div><div><br></div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Sep 26, 2019 at 10:35 PM Simon Hobson <<a href="mailto:dhcp1@thehobsons.co.uk">dhcp1@thehobsons.co.uk</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Surya Teja <<a href="mailto:suryateja042@gmail.com" target="_blank">suryateja042@gmail.com</a>> wrote:<br>
<br>
> I have an issue with dhcpd service restart when it handles a bulk lease data. As part of testing I have simulated the dhcp server to lease test using dhcperf tool to check the performance statistics when the dhcpserver handles a huge lease data Ex :300689(3M). It is taking 3 to 4 minutes of duration to start up the service, Is this the expected behaviour when we have a such large lease file ? (FYI: No memory, disk space problem on the system)<br>
> <br>
>  When I restarted dhcpd in the log message I have a seen statement like <br>
>  Wrote 300689 leases to leases file. <br>
> Does the restart dhcpd will rewrite the lease file again? <br>
> I also observed  as new lease file with extension ~ at end like after restart dhcpd<br>
> I see two lease file one with dhcpd.leases and other dhcpd.leases~<br>
>  If it is not expected behaviour can anyone have any reference tool or steps to check what is taking time to bring the service up <br>
<br>
It is a known issue that the server can take some time to start up when there is a large number of potential addresses in the defined pools. The reason for this being the way the server builds hashing tables internally. It is probably to be expected as well in the situation you've described - it must read the leases file and process each lease in turn, updating the internal structures as it goes.<br>
<br>
The leases file is a log file database - nothing is ever changed, only new entries added at the end. Obviously, such a file would grow without bounds over time without some sort of cleanup routine. Periodically, default is every hour, the server will write out a fresh leases file from it's internal structures - this file will contain no duplicate entries. It writes this to a new file, moves the existing lease file to a backup name (the one with "~" on the end), and moves the new file into place as the active leases file. The leases file is ONLY read at server startup and never after that - everything is done from in memory structures. In between cleanups as detailed above, every time anything changes, a new record is appended to the on-disk leases file.<br>
<br>
_______________________________________________<br>
dhcp-users mailing list<br>
<a href="mailto:dhcp-users@lists.isc.org" target="_blank">dhcp-users@lists.isc.org</a><br>
<a href="https://lists.isc.org/mailman/listinfo/dhcp-users" rel="noreferrer" target="_blank">https://lists.isc.org/mailman/listinfo/dhcp-users</a><br>
</blockquote></div>