Server-count and memory usage

Hi!

Does server-count:2 (or more) have an impact on the used memory (RAM)?

Currently I have count=1 on my slaves and memory is around 10G, peaking
to 20G+ during zone updates.

Thanks
Klaus

Hi Klaus,

The server count uses little memory. The main zone is forked with
copy-on-write, but not written, so it is shared (only read from) memory.
The extra servers with server-count use their own RRL table and their
own compression tables. This takes some Mbs, the RRL is ~20Mb by
default, and the compression table is 16bits per domain name: 2Mb per
million names.

TCP connections also use memory for buffers. That is per core, and when
the tcp connection is in use. If you allow lots (eg. 1000s) then also
those buffers add up to Mbs. That is ~70Mb for 1000 of tcp-count.

Setting server-count equal to the number of cpu cores is the suggested
value. (sometimes reserve a core for zone updates is suggested).

You can also save memory with options such as --disable-radix-tree and
--enable-packed, with memory optimisations in recent NSD releases also
saving memory.

Best regards, Wouter