Performance... no more than 150 leases per second?

Christian Hammers chammers at netcologne.de
Mon May 31 16:28:52 UTC 2010


Hello

Using gprof I figured that the big performance bottleneck of dhcpd is
in lease_enqueue() of mdb.c:

Each sample counts as 0.01 seconds.
  %   cumulative   self              self     total
 time   seconds   seconds    calls   s/call   s/call  name
 58.29     83.27    83.27   146214     0.00     0.00  lease_enqueue
 38.20    137.84    54.57    15145     0.00     0.00  supersede_lease
  0.40    138.41     0.57 48280486     0.00     0.00  get_char
  0.22    138.73     0.32 17001444     0.00     0.00  get_raw_token
 ...

Looking at this function I suspect that the main issue is still the same
for() loop as in 2003 (http://marc.info/?l=dhcp-server&m=104488701523671)

	/* Insertion sort the lease onto the appropriate queue. */
	for (; lp ; lp = lp->next) {
		if (lp -> sort_time >= comp -> sort_time)
			break;
		prev = lp;
	}

Isn't it possible find an algorithm that scales better with large queues?

bye,

-christian-


On Mon, 31 May 2010 16:00:39 +0200
Glenn Satchell <glenn.satchell at uniq.com.au> wrote:

> There used to be some performance issues with large subnets due to the 
> default hash sizes being a bit small. Ok for most networks, but you have 
> a /15 (?) so that could show up this situation.
> 
> Don't know how whether you can change your dhcpd.conf to use a bunch of 
> smaller subnets for the test.
> 
> I do know others on the list have reported >200k leases, so it is 
> possible to scale. Not sure what their lease times would be, so the 
> leases/second could be less than yours.
> 
> regards,
> -glenn
> 
> On 05/31/10 23:24, Christian Hammers wrote:
> > Hello
> >
> > I'm playing around with ISC dhcpd to get enough performance for a really big
> > network with 60000 clients that have a very short lease time of only half an
> > hour which calculates to about 33 leases per second.
> >
> > After starting dhcpd on a pretty decent server with lots of RAM and some
> > 3GHz cores I ended up with about 100-150 leases per second.
> >
> > While this was more than I need I still wonder what exactly limits the
> > server. dhcpd was running with 99% CPU and almost no I/O as I put the
> > leases directory on /dev/shm/ (just for testing!).
> >
> > That server can handle 1000 MySQL queries per second and not more than
> > 150 dhcpd leases (at 99% CPU!) which should be a lot easy to calculate?
> >
> > bye,
> >
> > -christian-
> >
> >
> >
> > client:/usr/local/nom/bin/dhcperf --retain-leases  --server x.x.x.x
> >    --test-duration 600 --test-load 300 --clients 100000
> >    --progress --discover
> >
> >
> > server:/usr/local/src/dhcp-4.1.1# server/dhcpd -V
> > Internet Systems Consortium DHCP Server 4.1.1
> >
> > server:/usr/local/src/dhcp-4.1.1# grep -v ^# /etc/dhcpd.conf
> > default-lease-time 3600;
> > max-lease-time 3600;
> > ddns-update-style none;
> >
> > deny duplicates;
> > authoritative;
> > one-lease-per-client true;
> >
> > log-facility local6;
> >
> > ping-check false;
> >
> > key defomapi {
> >     algorithm hmac-md5;
> >     secret se32and6tK6xxxxxxxxx;
> > };
> >
> > option domain-name-servers 81.173.197.16;
> >
> > omapi-key defomapi;
> > omapi-port 7911;
> >
> >
> > shared-network test {
> > subnet 10.10.0.0 netmask 255.254.0.0 {
> >     pool {
> >        deny dynamic bootp clients;
> >        range 10.10.0.2 10.11.255.254;
> >     }
> >     option bootfile-name "1.2.3.10";
> >     option routers 10.10.0.1;
> > }
> >
> > subnet 1.2.3.42 netmask 255.255.255.255 {
> > }
> >
> > subnet 1.2.3.51 netmask 255.255.255.255 {
> > }
> >
> > subnet 1.2.3.39 netmask 255.255.255.255 {
> > }
> > }
> >
> _______________________________________________
> dhcp-users mailing list
> dhcp-users at lists.isc.org
> https://lists.isc.org/mailman/listinfo/dhcp-users


-- 
NETCOLOGNE Gesellschaft für Telekommunikation mbH
Am Coloneum 9 | 50829 Köln
Tel: 0221 2222-8711 | Fax: 0221 2222-78711 

www.netcologne.de

Geschäftsführer:
Werner Hanf
Karl-Heinz Zankel
HRG 25580, AG Köln



More information about the dhcp-users mailing list