Problems with DHCP lease file cleaning and size

Simon Hobson dhcp1 at thehobsons.co.uk
Fri Aug 2 14:29:05 UTC 2013


Mohan Kannekanti wrote:
> Is there any mechanism in dhcpd which rewrite (like it does in when it starts) the lease file after some period??
Yes, it does this automatically.
> If so, What is the period and Is there any way to give this in conf file??
It's one hour - and I believe it's a compiled in default.

> Is there any way to keep limit on number of connections for an subnet??
> will there be any problem if we keep limit on number of entries to log in lease file and when
> limit is reached start writing (overriding) from beginning?? (similar to dmesg in kernel)

No, and there is never likely to be.
The reason the database is a log file is becuase that's a fairly easy way to meet certain mandatory requirements of the DHCP protocol.

You MUST commit lease information to persistent storage before offering it to the client - requires low latency/high throughput if you are going to be able to offer a decent service to more than a small number of clients. Any other sort of database generally creates a significant bottleneck/increases latency.

If you were to start over-writing the lease file from the beginning, then at some point I;d say you are fairly well guaranteed to over-write a lease record for something that's not so crazily busy loading up your server.


More information about the dhcp-users mailing list