NSD 4 / OS limitation problem?

Hi,

I recently tried to switch from nsd-3.2.19 -> nsd-4.1.3 on our largest DNS slave

$ grep -c zone: nsd.conf
514

But I stumbled upon a problem with NSD4. The log complains about memory allocation:


[2015-07-01 19:40:26.285] nsd[29189]: info: zone itsnat.se read with success
[2015-07-01 19:40:26.302] nsd[29189]: info: rehash of zone itsnat.se. with parameters 1 0 5 c393596e0fd9f7de
[2015-07-01 19:40:26.789] nsd[29189]: error: mmap(/var/nsd/nsd.db, size 1376910080) error Cannot allocate memory
[2015-07-01 19:40:26.846] nsd[29395]: error: did not get start signal from main

While I know that the database is much bigger in NSD4, this shouldn’t be a problem for a modern OS.

$ ls -l /var/nsd/nsd*.db

-rw-r--r-- 1 nsd nsd 162257814 Jul 1 19:37 /var/nsd/nsd3.db <— old NSD3 db
-rw------- 1 nsd nsd 1376910080 Jul 1 19:41 /var/nsd/nsd4.db <— NSD4 db

There is still plenty of room on /var too…
It doesn’t look like an obvious limitation in the OS either?

$ ulimit -a
socket buffer size (bytes, -b) unlimited
core file size (blocks, -c) unlimited
data seg size (kbytes, -d) 262144
file size (blocks, -f) unlimited
max locked memory (kbytes, -l) 1023162
max memory size (kbytes, -m) 3069488
open files (-n) 128
pipe size (512 bytes, -p) 1
stack size (kbytes, -s) 2048
cpu time (seconds, -t) unlimited
max user processes (-u) 160
virtual memory (kbytes, -v) unlimited

(OS is NetBSD 6_STABLE)

Any ideas?

/P

Hi,

I recently tried to switch from nsd-3.2.19 -> nsd-4.1.3 on our largest DNS slave

$ grep -c zone: nsd.conf
514

But I stumbled upon a problem with NSD4. The log complains about memory allocation:


[2015-07-01 19:40:26.285] nsd[29189]: info: zone itsnat.se read with success
[2015-07-01 19:40:26.302] nsd[29189]: info: rehash of zone itsnat.se. with parameters 1 0 5 c393596e0fd9f7de
[2015-07-01 19:40:26.789] nsd[29189]: error: mmap(/var/nsd/nsd.db, size 1376910080) error Cannot allocate memory
[2015-07-01 19:40:26.846] nsd[29395]: error: did not get start signal from main

While I know that the database is much bigger in NSD4, this shouldn’t be a problem for a modern OS.

[..]

(OS is NetBSD 6_STABLE)

32 or 64 bit?

Also how much memory does the box have physically?

No, swap does not count.

Greets,
Jeroen

Hi Fredrik,

But I stumbled upon a problem with NSD4. The log complains about
memory allocation:

While I don't have a direct answer for this specific question, I have a
suggestion. If you set:

database: ""

then NSD will not create a .db file at all. Instead, it will XFR the
zones in and just serve them from memory. Once an hour (configurable) it
will write out the zones in plain text to disk (for reading it at the
next restart).

This mode uses less memory. On our NSD slaves with about 5000 zones,
memory usage dropped from about 25GB to 17GB.

Regards,
Anand

Hi Anand,

Hi,

I recently tried to switch from nsd-3.2.19 -> nsd-4.1.3 on our largest DNS slave

$ grep -c zone: nsd.conf
514

But I stumbled upon a problem with NSD4. The log complains about memory allocation:


[2015-07-01 19:40:26.285] nsd[29189]: info: zone itsnat.se read with success
[2015-07-01 19:40:26.302] nsd[29189]: info: rehash of zone itsnat.se. with parameters 1 0 5 c393596e0fd9f7de
[2015-07-01 19:40:26.789] nsd[29189]: error: mmap(/var/nsd/nsd.db, size 1376910080) error Cannot allocate memory
[2015-07-01 19:40:26.846] nsd[29395]: error: did not get start signal from main

While I know that the database is much bigger in NSD4, this shouldn’t be a problem for a modern OS.

[..]

(OS is NetBSD 6_STABLE)

32 or 64 bit?

I forgot it was a 32-bit machine… time to upgrade.

Also how much memory does the box have physically?

8 GB, but I could be that I hit the 32-bit limit.

Anyway, running nsd with database: “” solved it for now.

Re,
/P

[..]

While I know that the database is much bigger in NSD4, this shouldn’t be a problem for a modern OS.

[..]

(OS is NetBSD 6_STABLE)

32 or 64 bit?

I forgot it was a 32-bit machine… time to upgrade.

32-bit definitely won't cut if.

Also how much memory does the box have physically?

8 GB, but I could be that I hit the 32-bit limit.

Won't help as each process still has a 3 GiB limit in that case.

Note that putting more mem in it while you are at it is likely a good idea.

Also note that with DNSSEC enabled everything magically explodes, thus
much more mem is definitely needed.

Greets,
Jeroen