dhcpd-4.2.2 maxsocks problem

Jan Markus markus.jan at seznam.cz
Thu Jan 12 17:49:53 UTC 2012


Hello,

Dne 01/12/2012 04:38 PM, Jeff Waller napsal(a):
> Without looking into the code too much I found the following comment in socket.c (see below):  Which I think
> means yea you can change the kernel to allow more file descriptors but you will run into problems
> trying to increase beyond either 4096 or FD_SETSIZE whichever is applicable depending on how
> the server was compiled.   It appears you can change that number maybe and re-compile but
> be wary.
>
> Here's what FD_SETSIZE is set to in linux:
>
> ./linux/posix_types.h:#define __FD_SETSIZE	1024
>
>
>
> Couple of things to try.
>
> 1)  First off, what is that number?  Is it 1024 or is it 4096?  Use gdb to find out where this is hitting the error.
> It maybe be as simple as gdb dhcpd core (modify to actual filenames if not all in the same
> directory).

My /usr/include/sys/select.h says:

#define FD_SETSIZE 1024U


"gdb dhcpd dhcpd.core" tells me this:

# gdb dhcpd dhcpd.core
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "amd64-marcel-freebsd"...
Core was generated by `dhcpd'.
Program terminated with signal 6, Aborted.
Reading symbols from /lib/libgcc_s.so.1...done.
Loaded symbols for /lib/libgcc_s.so.1
Reading symbols from /lib/libc.so.7...done.
Loaded symbols for /lib/libc.so.7
Reading symbols from /libexec/ld-elf.so.1...done.
Loaded symbols for /libexec/ld-elf.so.1
#0  0x00000008009d1fcc in kill () from /lib/libc.so.7
(gdb)

I am not very familiar with debugging, I'm afraid, but I can run commands you tell me and I've also 
"published" both of these files here:

http://109.238.32.55/dhcpd
http://109.238.32.55/dhcpd.core

If it could be of any help.


> 2)  Get 4.2.3  (4.2.2 is 6 months old).  I would have thought that you can simply download the
> source and compile, it doesn't compile on BSD??  If you're going to modify, you're going to need
> the source anyway.  And figure out a way to not use SELECT there is definitely support for
> this in configure but it looks like kqueue on by default; make sure.  BTW this is all bind stuff which
> dhcp depends on
>
> ./configure --help
>
> ....
>
>    --enable-kqueue         use BSD kqueue when available [default=yes]
>    --enable-epoll          use Linux epoll when available [default=auto]
>    --enable-devpoll        use /dev/poll when available [default=yes]
>
> ...

I've updated my FreeBSD ports, so I've got and compiled the 4.2.3 version. When I configured (the 
bind stuff) with --enable-kqueue, then dhcp daemon didn't die, but he started to use cca 91% of CPU.

Compiled without kqueue|epoll|devpoll this version also dies.

>
>
> ==================================================================================
> /*%
>   * Maximum number of allowable open sockets.  This is also the maximum
>   * allowable socket file descriptor.
>   *
>   * Care should be taken before modifying this value for select():
>   * The API standard doesn't ensure select() accept more than (the system default
>   * of) FD_SETSIZE descriptors, and the default size should in fact be fine in
>   * the vast majority of cases.  This constant should therefore be increased only
>   * when absolutely necessary and possible, i.e., the server is exhausting all
>   * available file descriptors (up to FD_SETSIZE) and the select() function
>   * and FD_xxx macros support larger values than FD_SETSIZE (which may not
>   * always by true, but we keep using some of them to ensure as much
>   * portability as possible).  Note also that overall server performance
>   * may be rather worsened with a larger value of this constant due to
>   * inherent scalability problems of select().
>   *
>   * As a special note, this value shouldn't have to be touched if
>   * this is a build for an authoritative only DNS server.
>   */
> #ifndef ISC_SOCKET_MAXSOCKETS
> #if defined(USE_KQUEUE) || defined(USE_EPOLL) || defined(USE_DEVPOLL)
> #define ISC_SOCKET_MAXSOCKETS 4096
> #elif defined(USE_SELECT)
> #define ISC_SOCKET_MAXSOCKETS FD_SETSIZE
> #endif  /* USE_KQUEUE... */
> #endif  /* ISC_SOCKET_MAXSOCKETS */
> ==================================================================================
>
>
>
>

Thank you very much so far.
-Jan


> On Jan 12, 2012, at 8:51 AM, Jan Markus wrote:
>
>> Hello,
>>
>> we have isc-dhcpd 4.2.2 from ports on FreeBSD 8.2. We have cca 1050 Vlan interfaces:
>>
>>
>> ifconfig vlan1234 create inet 10.0.0.1/29 vlan 1234 vlandev igb1
>>
>>
>> and the same number of dhcpd declarations like this:
>>
>> shared-network vlan1234 {
>>      subnet 10.0.0.0 netmask 255.255.255.248 {
>>          range 10.0.0.2 10.0.0.5;
>>          option routers 10.0.0.1;
>>      }
>> }
>>
>> But our DHCP server refuses to start, saying:
>>
>> ../../../../lib/isc/unix/socket.c:958: INSIST(fd>= 0&&  fd<  (int)manager->maxsocks) failed, back trace
>> #0 0x52a5ca in ??
>> #1 0x52a77a in ??
>> #2 0x54768b in ??
>> #3 0x548f63 in ??
>> #4 0x46fc80 in ??
>> #5 0x445cfb in ??
>> #6 0x40de69 in ??
>> #7 0x40c38e in ??
>> #8 0x8006bc000 in ??
>> Abort trap (core dumped)
>> /usr/local/etc/rc.d/isc-dhcpd: WARNING: failed to start dhcpd
>>
>> My kernel sockets limits are:
>>
>> # sysctl -a | grep soc
>> kern.ipc.maxsockbuf: 16777216
>> kern.ipc.maxsockets: 204800
>> kern.ipc.numopensockets: 17
>> net.inet.ip.mcast.maxsocksrc: 128
>>
>> Please, what should I do?
>>
>> Thank you very much for your time.
>> -Jan
>> _______________________________________________
>> dhcp-users mailing list
>> dhcp-users at lists.isc.org
>> https://lists.isc.org/mailman/listinfo/dhcp-users
>
> _______________________________________________
> dhcp-users mailing list
> dhcp-users at lists.isc.org
> https://lists.isc.org/mailman/listinfo/dhcp-users
>




More information about the dhcp-users mailing list