dhcpd-4.2.2 maxsocks problem

Jan Markus markus.jan at seznam.cz
Thu Jan 12 17:54:41 UTC 2012


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).

Oh, one more thing, it will be of any help:


#0  0x00000008009d1fcc in kill () from /lib/libc.so.7
(gdb) bt
#0  0x00000008009d1fcc in kill () from /lib/libc.so.7
#1  0x00000008009d0dcb in abort () from /lib/libc.so.7
#2  0x000000000052b71f in isc_assertion_failed (file=Variable "file" is not available.
) at ../../../lib/isc/assertions.c:58
#3  0x000000000054872b in select_poke (manager=0x157cc, fd=Variable "fd" is not available.
) at ../../../../lib/isc/unix/socket.c:959
#4  0x000000000054a013 in isc__socket_fdwatchcreate (manager0=0x800c69000, fd=1024, flags=1,
     callback=0x46e930 <omapi_iscsock_cb>, cbarg=0x801908460, task=0x800c6e000, socketp=0x8019084b0)
     at ../../../../lib/isc/unix/socket.c:2699
#5  0x0000000000470340 in omapi_register_io_object (h=0x8011d0f00, readfd=0x444860 <if_readsocket>, 
writefd=0,
     reader=0x4452c0 <got_one>, writer=0, reaper=0) at dispatch.c:259
#6  0x0000000000445e9b in discover_interfaces (state=1) at discover.c:1289
#7  0x000000000040de69 in main (argc=Variable "argc" is not available.
) at dhcpd.c:709
(gdb)

-Jan


>
> 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]
>
> ...
>
>
> ==================================================================================
> /*%
>   * 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 */
> ==================================================================================
>
>
>
>
> 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