The initial request
from a client for an address from a DHCP server often goes through a
DHCPDISCOVER-DHCPOFFER-DHCPREQUEST-DHCPACK cycle. This process requires that
the server must consult the database twice per request for client data. If the
client caching parameters are set, the DHCP server caches client data in memory
so that it only needs to consult the database once. Client caching can provide
a noticeable performance improvement in systems that store client information
in LDAP. Client caching is enabled by default unless you unset the applicable
You can adjust the
maximum cache count and time-to-live (TTL) parameters based on the expected
rate of client requests. If you expect an onslaught of requests, you might want
to increase the cache count, up to a limit based on your available memory. If
you expect a longer request cycle, you might want to increase the TTL. The aim
is to have the server consult the client cache once during the request cycle.
To set the limit on
the number of entries that the server keeps in the client cache, use the
client-cache-count attribute on the Edit DHCP Server page, or
client-cache-count in the CLI. By default,
the maximum number to cache is 1000 clients. To disable the cache, set the
attribute to 0.
The client cache is
usually valid for only ten seconds, called the cache TTL. After the TTL
expires, the server reads the client information from the database, if
necessary. You can adjust the TTL using the
attribute on the Edit DHCP Server page, or
client-cache-ttl in the CLI.
When the client cache
count reaches the specified maximum, the server cannot cache any more clients
until a client-entry TTL expires, after which it reads from the database and
begins caching again.
The DHCP server, by
default, caches client data while processing DISCOVER message only. If you want
to cache client data during REQUEST (Renew or Rebind) message, you need to set
cache-client-for-requests attribute to true. This attribute can be configured
on the Edit DHCP Server page, or using
dhcp set cache-client-for-requests in the CLI. This attribute
should be set to true only if the duration between the two REQUEST (Renew or
Rebind) messages are lesser than the cache TTL.