Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


NSD Memory Usage on Debian Wheezy
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

NSD Memory Usage on Debian Wheezy

Anyone running NSD on Debian Wheezy? Memory usage has gone beserk.

These are both OpenVz / vSwap VMs:

Debian Squeeze production ns1: nsd v. 3.2.12. 131 zones, 1,178 records, ~600,000 queries/month:

[root@ns1:~] ps aux | grep nsd
nsd       5501  0.0  1.3  11276  1732 ?        S    Aug19   0:17 /usr/sbin/nsd -c /etc/nsd3/nsd.conf
nsd      23494  0.0  0.6   4208   812 ?        S    Aug20   0:00 /usr/sbin/nsd -c /etc/nsd3/nsd.conf
nsd      23496  0.0  0.7   4620   940 ?        S    Aug20   0:02 /usr/sbin/nsd -c /etc/nsd3/nsd.conf

Debian Wheezy testbox: nsd v. 3.2.12. 0 zones, 0 records, 0 queries:

[root@testbox:~] ps aux | grep nsd
nsd       3864  0.0 36.4  51600 47768 ?        Ss   10:00   0:00 /usr/sbin/nsd -c /etc/nsd3/nsd.conf
nsd       3872  0.0 18.4  58260 24176 ?        S    10:00   0:00 /usr/sbin/nsd -c /etc/nsd3/nsd.conf
nsd       3873  0.0 18.2  51600 23952 ?        S    10:00   0:00 /usr/sbin/nsd -c /etc/nsd3/nsd.conf

Comments

  • rm_rm_ IPv6 Advocate, Veteran
    # ps aux | grep nsd
    nsd      24600  0.0  9.5  68556 48316 ?        Ss   11:28   0:00 /usr/sbin/nsd -c /etc/nsd3/nsd.conf
    nsd      24601  0.0  4.8  75156 24360 ?        S    11:28   0:00 /usr/sbin/nsd -c /etc/nsd3/nsd.conf
    nsd      24602  0.0  4.8  68768 24560 ?        S    11:28   0:00 /usr/sbin/nsd -c /etc/nsd3/nsd.conf

    Yes I am seeing the same. But I did not run it before Wheezy, so can't compare. I agree that it uses way too much RAM for what it does (only about 8-10 zones on mine).

  • sleddogsleddog Member
    edited August 2013

    @rm_, thanks for confirming. Looks like it's caused by the package build environment.

    I built nsd v. 3.2.16 from source on my Wheezy testbox, matching the configuration of the packaged version [1], and copied the 7 nsd binaries [2] to /usr/sbin, then started nsd:

    [root@testbox:~] ps aux | grep nsd
    nsd      17352  0.0  0.5   4496   752 ?        Ss   12:28   0:00 /usr/sbin/nsd -c /etc/nsd3/nsd.conf
    nsd      17368  0.0  0.6  11360   832 ?        S    12:28   0:00 /usr/sbin/nsd -c /etc/nsd3/nsd.conf
    nsd      17369  0.0  0.3   4496   496 ?        S    12:28   0:00 /usr/sbin/nsd -c /etc/nsd3/nsd.conf

    Someone needs to build a sensible nsd package for Wheezy :)

    [1] Source build configuration:

    ./configure --prefix=/usr --with-configdir=/etc/nsd3 --with-nsd_conf_file=/etc/nsd3/nsd.conf --with-user=nsd --with-dbfile=/var/lib/nsd3/nsd.db --with-pidfile=/var/run/nsd3/nsd.pid

    [2] Actually 6 binaries and one bash script. nsdc.sh from the source build becomes /usr/sbin/nsdc (no .sh extension).

  • rm_rm_ IPv6 Advocate, Veteran
    edited August 2013

    If you care enough, write a bug-report to http://bugs.debian.org/nsd3
    It would also help if you could figure out what exactly is wrong with the "stock" build process, prior to that.

  • I could, but I get the impression that there's not much activity these days with the NSD debian packaging.

    How we have v. 3.2.12 in Wheezy, a release from a year ago that existed for only eight days, is a mystery to me....

  • @sleddog, @rm_

    This is because of the default settings for the response rate limiting. There is no need for package rebuild. It is only matter of configuration. See https://blog.srvbox.com/nsd3-eating-up-memory-after-update-to-wheezy-version-3-2-12-3/ for details.

  • Here is some more info: https://www.nlnetlabs.nl/blog/2012/10/11/nsd-ratelimit/

    I set rrl-size: 1 (it won't accept 0),
    rrl-ratelimit: 0
    rrl-whitelist-ratelimit: 0

    And that drops memory usage by about 25MB.
    Sleddog did not compile with –enable-ratelimit, which should give about the same result.

    Keeping rate limiting on, but setting rrl-size: 100000 (one tenth of the default) drops about 20MB of memory.

  • I see it now. The 3.2.12-3 in Wheezy has rate-limiting compiled in, while the 3.2.12-1 in backports (which I installed on Squeeze) does not. From the Debian NSD changelog:

    nsd3 (3.2.12-2) unstable; urgency=low
    
      * Add Response Rate Limiting patch (Courtesy of Matthijs Mekking of NLnet Labs)
      * Regenerate configure due to RRL patch and ./configure with --enable-ratelimit
    
     -- Ondřej Surý   Wed, 06 Feb 2013 14:09:36 +0100
Sign In or Register to comment.