tuning for maximum dhcp performance
David W. Hankins
David_Hankins at isc.org
Tue May 6 21:07:34 UTC 2008
On Tue, May 06, 2008 at 11:49:46AM -0700, Brad Dameron wrote:
> Local6.* -/var/log/dhcpd.log
this actually stops it from fsync'ing after every write, which
competes with dhcpd if it's on the same spindle as dhcpd.leases.
> In the includes/dhcpd.h file find LEASE_HASH_SIZE. Change it from 100003
> to 250007.
in 3.0.x, everything had the same default hash size called
DEFAULT_HASH_SIZE in includes/omapip/hash.h, and defaulted to
something rediculously small (9973) for leases which was rediculously
large for everything else.
in 3.1.x, we adjusted a lot of the hash tables (some down that were
rediculously oversized, some up...lease hash went up) so the defaults
were less rediculous. one of our design constraints was making sure
we kept a "zero sum" - so 'dhcpd' with an empty config didn't change
very much in size (if at all). we basically used all the free space
from downsizing some tables to upscale others.
at some point in some future revision, we'll make the tables scale
themselves upwards as needed (size and allocate the tables after
loading config, then put all the leases in them).
but for now you want to pick a number that is larger than the number
of dynamic leases in the database, and preferrably also prime (it
reduces an overlap condition if you use disjoint subnets (e.g. from
different NIC allocations)).
you can google for a list of prime numbers.
i also have some ideas to improve the string ("option name hash") and
data ("client id / hardware address hash") hash-key generator
functions, as there are still some collisions in the default hash
tables that i couldn't smooth out by playing with table sizes.
Ash bugud-gul durbatuluk agh burzum-ishi krimpatul.
Why settle for the lesser evil? https://secure.isc.org/store/t-shirt/
David W. Hankins "If you don't do it right the first time,
Software Engineer you'll just have to do it again."
Internet Systems Consortium, Inc. -- Jack T. Hankins
More information about the dhcp-users