restructuring/redesigning BIND (was Re: 9.2.5 db causes high cpu?)

Paul Vixie paul at vix.com
Tue Feb 22 19:13:01 UTC 2005


> At the risk of tangentially ratholing, note some file sizes:
> 
> 	dnscache 	 127728
> 	tinydns		  86132
> 	named-9.3.0	4910768
> 	apache-2.0.46	  21896
> 	apache-1.3.27	 385356
> 	
> If I may play at being systems programmer for a moment, it would seem
> to me that the Apache scheme of providing functionality with DSOs
> pulled in at configuration time could supply the benefits of a
> smaller, more concise code base while providing the framework for the
> future, in-progress items, such as TSIG, IPv6, and related.

sounds like you're being fooled by the size of the libraries.  there's
already excellent separation between the mainline and the various modules
that provide the various functionality.  we just don't put functionality
into user-specified *.so files the way apache2 does.  (note that i'd like
us to do this for things like SQL and other backend support, but not for
things like protocol processing.)

here's what "./configure --enable-threads" produces on a freebsd5.3/amd64
system (after make depend all install clean):

#fh:amd64# ldd /usr/local/sbin/named
/usr/local/sbin/named:
        libcrypto.so.3 => /lib/libcrypto.so.3 (0x5e389000)
        libpthread.so.1 => /usr/lib/libpthread.so.1 (0x5e5d7000)
        libc.so.5 => /lib/libc.so.5 (0x5e701000)
#fh:amd64# ls -l /usr/local/sbin/named
-rwxr-xr-x  2 root  wheel  3506786 Feb 21 02:55 /usr/local/sbin/named*
#fh:amd64# ls -l /usr/local/lib/lib*|grep 02:55
-rw-r--r--  1 root  wheel    76586 Feb 21 02:55 /usr/local/lib/libbind9.a
-rw-r--r--  1 root  wheel  4360922 Feb 21 02:55 /usr/local/lib/libdns.a
-rw-r--r--  1 root  wheel  1062350 Feb 21 02:55 /usr/local/lib/libisc.a
-rw-r--r--  1 root  wheel   130048 Feb 21 02:55 /usr/local/lib/libisccc.a
-rw-r--r--  1 root  wheel   240914 Feb 21 02:55 /usr/local/lib/libisccfg.a
-rw-r--r--  1 root  wheel   313966 Feb 21 02:55 /usr/local/lib/liblwres.a

here's the same thing adding "--with-libtool" and "--enable-shared" (and
aren't i glad that "make -j3" works on this system or it'd take forever):

#fh:amd64# ldd /usr/local/sbin/named
/usr/local/sbin/named:
        liblwres.so.3 => /usr/local/lib/liblwres.so.3 (0x5e275000)
        libdns.so.20 => /usr/local/lib/libdns.so.20 (0x5e386000)
        libbind9.so.0 => /usr/local/lib/libbind9.so.0 (0x5e5a5000)
        libisccfg.so.1 => /usr/local/lib/libisccfg.so.1 (0x5e6ac000)
        libcrypto.so.3 => /lib/libcrypto.so.3 (0x5e7c4000)
        libisccc.so.2 => /usr/local/lib/libisccc.so.2 (0x5ea12000)
        libisc.so.10 => /usr/local/lib/libisc.so.10 (0x5eb1a000)
        libpthread.so.1 => /usr/lib/libpthread.so.1 (0x5ec59000)
        libc.so.5 => /lib/libc.so.5 (0x5ed83000)
#fh:amd64# ls -l /usr/local/sbin/named
-rwxr-xr-x  2 root  wheel  758918 Feb 22 19:09 /usr/local/sbin/named*
#fh:amd64# ls -l /usr/local/lib/lib* | grep 19:09 | grep -v '>'
-rw-r--r--  1 root  wheel    76586 Feb 22 19:09 /usr/local/lib/libbind9.a
-rw-r--r--  1 root  wheel      801 Feb 22 19:09 /usr/local/lib/libbind9.la
-rw-r--r--  1 root  wheel    54113 Feb 22 19:09 /usr/local/lib/libbind9.so.0
-rw-r--r--  1 root  wheel  4360922 Feb 22 19:09 /usr/local/lib/libdns.a
-rw-r--r--  1 root  wheel      824 Feb 22 19:09 /usr/local/lib/libdns.la
-rw-r--r--  1 root  wheel  2305954 Feb 22 19:09 /usr/local/lib/libdns.so.20
-rw-r--r--  1 root  wheel  1062350 Feb 22 19:09 /usr/local/lib/libisc.a
-rw-r--r--  1 root  wheel      790 Feb 22 19:09 /usr/local/lib/libisc.la
-rw-r--r--  1 root  wheel   528814 Feb 22 19:09 /usr/local/lib/libisc.so.10
-rw-r--r--  1 root  wheel   130048 Feb 22 19:09 /usr/local/lib/libisccc.a
-rw-r--r--  1 root  wheel      826 Feb 22 19:09 /usr/local/lib/libisccc.la
-rw-r--r--  1 root  wheel    77318 Feb 22 19:09 /usr/local/lib/libisccc.so.2
-rw-r--r--  1 root  wheel   240914 Feb 22 19:09 /usr/local/lib/libisccfg.a
-rw-r--r--  1 root  wheel      894 Feb 22 19:09 /usr/local/lib/libisccfg.la
-rw-r--r--  1 root  wheel   165806 Feb 22 19:09 /usr/local/lib/libisccfg.so.1
-rw-r--r--  1 root  wheel   313966 Feb 22 19:09 /usr/local/lib/liblwres.a
-rw-r--r--  1 root  wheel      801 Feb 22 19:09 /usr/local/lib/liblwres.la
-rw-r--r--  1 root  wheel   159316 Feb 22 19:09 /usr/local/lib/liblwres.so.3

so, there could be some toe-may-toe vs. toe-mah-toe going on here, right?

(note that "./configure --help" says that --enable-shared is the default,
but in my experience it has to be set explicitly along with --with-libtool
or you don't get shared libraries.)

(also note that since "named" is the only client for most of these libraries,
the in-core savings from "--enable-shared --enable-libtool" is nonexistent.)


More information about the bind-workers mailing list