ISC-dhcp subnet limit?

Rob Morin rmorin at datavalet.com
Fri Jan 29 15:58:10 UTC 2016


Hey Denis, thanks for the response...

I was just using apt to install isc-dchp server on ubuntu 14.04
Server is quad core xeon with 8 gigs of ram with a software raid 1 disks

But maybe i should consider your way...

I was just doing some testing using a ramdisk for the 
/var/lib/dhcp/dchpd.leases files

Our leases are short for special reasons... 20 minutes

so on a dev machine i created a ramdisk of 2 gigs, and backup the leases 
files to  a hard disk each 5 mins, and on restart the 
/etc/init/isc-dhcp-server.conf will  copy the files from backup to 
/ramdisk  then start dhcp

on dev it works fine... but i may consider your way now...

we tend to shy away from compiling stuff.. :(

Even after 24 hours after start of  the peer never came out of recovery 
mode, not sure why..

Currently we made dhcp-2 a standalone server and it currently has 217335 
leases in it, but i will need to double that at least in coming weeks..

Server is currently ....

top - 10:55:08 up 22:55,  2 users,  load average: 2.00, 1.99, 1.93
Tasks: 116 total,   1 running, 115 sleeping,   0 stopped,   0 zombie
%Cpu0  :  0.9 us,  0.5 sy,  0.0 ni, 25.8 id, 72.8 wa,  0.0 hi,  0.0 si,  
0.0 st
%Cpu1  :  1.4 us,  0.5 sy,  0.0 ni, 74.3 id, 23.4 wa,  0.0 hi,  0.5 si,  
0.0 st
%Cpu2  :  0.0 us,  0.0 sy,  0.0 ni,100.0 id,  0.0 wa,  0.0 hi,  0.0 si,  
0.0 st
%Cpu3  :  0.5 us,  0.0 sy,  0.0 ni, 99.5 id,  0.0 wa,  0.0 hi,  0.0 si,  
0.0 st
KiB Mem:   8092320 total,  5007076 used,  3085244 free,   164496 buffers
KiB Swap:  7810044 total,        0 used,  7810044 free.  4129916 cached Mem

   PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ 
COMMAND
12979 root      20   0  565060 559220   2524 D   2.3  6.9  15:08.17 dhcpd
  1713 syslog    20   0  255848   2924   2428 S   0.9  0.0   3:16.05 
rsyslogd
   215 root      20   0       0      0      0 S   0.5  0.0   2:00.89 
jbd2/md2-8
   412 root       0 -20       0      0      0 S   0.5  0.0   1:13.95 
kworker/0:1H
14300 root      20   0       0      0      0 S   0.5  0.0   0:41.33 
kworker/0:2
     1 root      20   0   33620   4284   2824 S   0.0  0.1   0:01.19 init

I will try your suggestion on dev machine
Do you use or know of a tool that i can use to simulate dhcp request for 
testing on my dev machine?

Thanks for your help!

Rob Morin
Montreal, Canada
  
CE COURRIEL AINSI QUE CES DOCUMENTS JOINTS peuvent contenir des renseignements confidentiels et privilégiés. Si vous n’êtes pas le destinataire désigné, veuillez nous en informer immédiatement et effacer toute copie. Merci.
THIS EMAIL AND THE DOCUMENTS ATTACHED may contain privileged or confidential information. If the reader of this message is not the intended recipient, please notify the sender immediately and delete the original message. Thank you.

On 2016-01-29 9:58 AM, Denis Laventure wrote:
>
> Hi Rob,
>
> I can't help for issue on your interface problem but I think I can 
> help with the performance.
>
> I used to have performance problem with my failover setup and someone 
> at ISC told me to change some value in the code to get debug 
> information about memory usage.
>
> Add this to the file "includes/dhcpd.h"
>
> #if !defined (REPORT_HASH_PERFORMANCE)
>
> # define REPORT_HASH_PERFORMANCE 1
>
> #endif
>
> Compile and start the daemon and you should get something like this on 
> screen and in the log:
>
> dhcpd: DHCP name hash: Contents/Size (%): 106/401 (26%). Min/max: 0/2
>
> dhcpd: DHCP code hash: Contents/Size (%): 106/254 (41%). Min/max: 0/1
>
> dhcpd: NWIP name hash: Contents/Size (%): 11/17 (64%). Min/max: 0/2
>
> dhcpd: NWIP code hash: Contents/Size (%): 11/17 (64%). Min/max: 0/1
>
> dhcpd: FQDN name hash: Contents/Size (%): 8/13 (61%). Min/max: 0/2
>
> dhcpd: FQDN code hash: Contents/Size (%): 8/13 (61%). Min/max: 0/1
>
> dhcpd: VIVCO name hash: Contents/Size (%): 1/127 (0%). Min/max: 0/1
>
> dhcpd: VIVCO code hash: Contents/Size (%): 1/127 (0%). Min/max: 0/1
>
> dhcpd: VIVSO name hash: Contents/Size (%): 1/127 (0%). Min/max: 0/1
>
> dhcpd: VIVSO code hash: Contents/Size (%): 1/127 (0%). Min/max: 0/1
>
> dhcpd: ISC name hash: Contents/Size (%): 2/3 (66%). Min/max: 0/1
>
> dhcpd: ISC code hash: Contents/Size (%): 2/3 (66%). Min/max: 0/1
>
> dhcpd: Relay Agent name hash: Contents/Size (%): 5/11 (45%). Min/max: 0/1
>
> dhcpd: Relay Agent code hash: Contents/Size (%): 5/11 (45%). Min/max: 0/1
>
> dhcpd: Server-Config Option name hash: Contents/Size (%): 67/136 
> (49%). Min/max: 0/4
>
> dhcpd: Server-Config Option code hash: Contents/Size (%): 67/136 
> (49%). Min/max: 0/1
>
> dhcpd: data: hardware: no raw packet or lease is available
>
> dhcpd: data: hardware: no raw packet or lease is available
>
> dhcpd: data: hardware: no raw packet or lease is available
>
> dhcpd: data: hardware: no raw packet or lease is available
>
> dhcpd: data: hardware: no raw packet or lease is available
>
> dhcpd: data: hardware: no raw packet or lease is available
>
> dhcpd: Config file: /dhcpd/dhcpd.conf
>
> dhcpd: Database file: /dhcpd/dhcpd.leases
>
> dhcpd: PID file: /var/run/dhcpd.pid
>
> dhcpd: Wrote 0 class decls to leases file.
>
> dhcpd: Wrote 0 deleted host decls to leases file.
>
> dhcpd: Wrote 0 new dynamic host decls to leases file.
>
> dhcpd: Wrote 48578 leases to leases file.
>
> dhcpd: Host HW hash:   Contents/Size (%): 1420/22501 (6%). Min/max: 0/4
>
> dhcpd: Host UID hash:  No table.
>
> dhcpd: Lease IP hash:  Contents/Size (%): 70324/100003 (70%). Min/max: 0/5
>
> dhcpd: Lease UID hash: Contents/Size (%): 8708/100003 (8%). Min/max: 0/3
>
> dhcpd: Lease HW hash:  Contents/Size (%): 9036/100003 (9%). Min/max: 0/3
>
> "Lease IP hash" is where you should look.
>
> By default the server use a lease hash size value of 100003. I had 
> over 350000 leases so I was exceeding that value and the server was 
> very slow to start.
>
> To change the size you must edit the file "includes/dhcpd.h" and find 
> LEASE_HASH_SIZE and replace the value. This value must be a prime 
> number (I used 400009).
>
> -# define LEASE_HASH_SIZE       100003
>
> +# define LEASE_HASH_SIZE       400009
>
> Compile and start again. That was the answer for me.
>
> One other thing with the failover setup, the peer will always be in 
> recover state when starting for the duration of the "MCLT" (time in 
> second) in your failover definition (1800 in your case), so it will be 
> in recover start for 30 minutes. I use 300 (5 minutes).
>
> Le texte aurait été plus facile à écrire en français mais comme la 
> liste est en anglais et que ça peut aider d'autres personnes alors je 
> me suis forcé. En espérant que ce soit clair pour toi !
>
> Denis Laventure
>
> Université du Québec à Chicoutimi
>
> *De :*dhcp-users-bounces at lists.isc.org 
> [mailto:dhcp-users-bounces at lists.isc.org] *De la part de* Rob Morin
> *Envoyé :* 27 janvier 2016 20:12
> *À :* dhcp-users at lists.isc.org
> *Objet :* ISC-dhcp subnet limit?
>
> Hello all, my first post here, so please be gentle J
>
> I have inherited 2 dhcp servers, one primary(dhcp-1) & one 
> secondary(dhcp-2) running isc-dhcpd-4.2.4 on Ubuntu 14.0(Trusty)
>
> We are having a few issues, and I cannot seem to figure out whats 
> going on. I have a few questions, maybe someone can help me with.
>
> Is there a max limit to how many subnets can be used in the pools? As 
> currently we are using just over 6000 subnets
>
> Currently our secondary dhcp-server is always in recovery mode, not 
> sure why?
>
> Does it matter if a DISCOVER comes in on eth1 but OFFER goes out on eth0?
>
> My primary server /etc/dhcpd.conf file
>
> authoritative;
>
> log-facility local7;
>
> option domain-name "dyn";
>
> option domain-name-servers 172.30.64.210, 172.30.64.220;
>
> default-lease-time 1200;
>
> max-lease-time 3600; # 1h
>
> include "/etc/dhcp/dhcpd_pools.conf";
>
> # Include the primary configuration
>
> include "/etc/dhcp/dhcpd_primary.conf";
>
> /etc/dhcp/dhcpd_primary has the following
>
> ## PRIMARY
>
> failover peer "tdl-dhcp-failover" {
>
>   primary; # declare this to be the primary server
>
>                address 172.30.128.9;
>
>                port 647;
>
>   peer address 172.30.128.10;
>
>   peer port 647;
>
>   max-response-delay 30;
>
>   max-unacked-updates 10;
>
>   load balance max seconds 3;
>
>   mclt 1800;
>
>   split 128;
>
> }
>
> Exert from dhcpd_pools file, starts like this….
>
> subnet 10.32.0.0 netmask 255.255.255.0 {
>
>   option routers 10.32.0.1;
>
>   pool {
>
>         failover peer "dhcp-failover";
>
>         range 10.32.0.5 10.32.0.254;
>
>   }
>
> }
>
> And finishes like this, with all the subnets in between…
>
> subnet 10.57.255.0 netmask 255.255.255.0 {
>
>   option routers 10.57.255.1;
>
>   pool {
>
>         failover peer "dhcp-failover";
>
>         range 10.57.255.5 10.57.255.254;
>
>   }
>
> }
>
> Example Exert from logs on both serves of a client that could not get 
> an IP
>
>
> from dhcp-1
> Jan 27 18:30:31 dhcp-1 dhcpd: DHCPDISCOVER from fc:e9:98:bc:a8:7b 
> (iPhone) via 10.50.170.1
> Jan 27 18:30:31 dhcp-1 dhcpd: DHCPOFFER on 10.50.170.93 to 
> fc:e9:98:bc:a8:7b (iPhone) via 10.50.170.1
>
> from dhcp-2
> Jan 27 18:53:55 dhcp-2 dhcpd: DHCPDISCOVER from fc:e9:98:bc:a8:7b via 
> 10.50.170.1: peer holds all free leases
> Jan 27 18:54:04 dhcp-2 dhcpd: DHCPDISCOVER from fc:e9:98:bc:a8:7b via 
> 10.50.170.1: peer holds all free leases
>
> Never see the ACK.
>
> Any suggestion would be greatly appreciated.. :
>
> Thanks…
>
> Rob
>
> Montreal Canada
>
>
>
> _______________________________________________
> dhcp-users mailing list
> dhcp-users at lists.isc.org
> https://lists.isc.org/mailman/listinfo/dhcp-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/dhcp-users/attachments/20160129/88dc2567/attachment-0001.html>


More information about the dhcp-users mailing list