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
On 2015-07-02 08:10, Fredrik Pettai wrote:> 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
On 02/07/15 08:10, Fredrik Pettai wrote: 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