Load times for Large Subnets
Larry Apolonio
isc-dhcp at rh73.com
Tue Oct 9 17:51:12 UTC 2007
Simon Hobson wrote:
> Larry Apolonio wrote:
>
>> I was wondering if there is a way I could speed up the startup time of
>> our DHCP server.
>>
>> I've compiled 3.1.0 on a 64 bit RHEL 5 box. I then created a dhcpd.conf
>> file which had 144 subnets with 410,000 available IP addresses for
>> lease.
>
>
> That's nearly 3,000 addresses per subnet, is that required ?
>
> I believe that reducing the number of available addresses can make a
> significant impact on startup times - so if you only needed (say) 300
> addresses, cutting each subnet down to whatever is needed plus a
> reasonable margin should deal with the problem.
Yes, they are fairly huge subnets, some are /19, /20, and a few /21.
All non rfc1918.
But I did find an answer to my question, in the source code there is a
folder called includes/dhcpd.h
There is this section
#if !defined (LEASE_HASH_SIZE)
# define LEASE_HASH_SIZE 100003
#endif
Basically I up'd that number by an order of magnitude + some (I think it
was 20000003) and my load times dropped from 20 minutes to 6 seconds.
For those wondering, I believe 20000003 is a prime number.
This section was in dhcp-3.1.0 and dhcp-4.0.0.a3 but it was not in the
RHEL SRPMS dhcp-3.0.5.
There certainly was a huge cost in memory, I think it took nearly a GB
of RAM, but dhcperf showed similar results in 4 way handshakes.
The leases file was also in tmpfs, also switching to an AMD box did
improve performance a little with its Hypertransport technology.
Does anyone know if there are any other problems that will arise when I
increased this number? What other tweaks are there that I can do to
improve transaction performance. Would be nice to be able to do 100,000
four way handshakes per hour.
Thanks,
Larry Apolonio
More information about the dhcp-users
mailing list