full socket buffers

Miroslav Lauš mirek at admino.cz
Mon Dec 20 07:42:01 UTC 2010

On Dec 20, 2010, at 8:33 AM, sthaug at nethelp.no wrote:

>> I've tried with ramdisk but have a small problem with it - the ramdisk is 1GB in
>> size but after about six hours the dhcpd started to complain there's no space
>> to commit the leases and crashed a few moments later. How big should the ramdisk
>> be in size to hold the leasefile? Is the dhcpd process doing some leasefile
>> compaction in time or just the leasefile grows boundless?
> You need space for 2 times the size of the largest leases file. Look 
> at the directory - you would normally be expected to have dhcpd.leases
> and dhcpd.leases~ (the latter being the previous version of the file).
> dhcpd.leases is only written to during normal operation, but about
> once per hour a new version is generated and the old is renamed to
> dhcpd.leases~. The new version is compacted as it is generated.
> Note that having dhcpd.leases on ramdisk may give you problems if the
> server crashes - you have then lost the leases file.

It seems I have to allocate the ramdisk with -o reserve option otherwise
the kernel can fail to allocate the space in progress. 500MB should be enough
as the secondary peer never had a leasefile bigger than 150MB.

I'm aware of loosing the leasefile so I've setup a minute cronjob to copy the
leasesfile out of the ramdisk.

I can live with that risk if the performace won't be affected.


More information about the dhcp-users mailing list