Help to identify origin of (visible) increase in DNS Server's RAM usage from v12 to v13 #1111
-
Hello @ShreyasZare, I have been running Technitium DNS Server in 2 cloud virtual machines for 6 months or so. They have just 1 GB RAM, but with the Windows Server core edition it has been quite manageable (probably because I host only one zone, also use them as caching resolvers for public names, QPM rate limiting has been set to inhibit excessive usage by others). Since the very beginning, I have had a 2nd DNS Server instance inside each machine to function as a root zone secondary for the 1st DNS Server instance. (Like your blog describes) This is the usual memory footprint for both DNS services:
The addition of ZONEMD you announced a few weeks back (with version 13) caught my interest - I had an expectation of being able to lower the memory footprint (even if just a little) by moving the secondary root zone into the primary DNS Server service (thus eliminating the overhead of a 2nd running windows service). Today I upgraded 12.2.1 to 13.1.1 in one of the servers. All I did was:
But the hoped for expectation was actually something of a surprise:
A single 13.1.1 instance is consuming 50% more RAM than the two 12.2.1 instances I had before. The DNS Apps installed are: The only optional DNS Server protocol configured is DoT. Regards |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Thanks for asking. The memory is managed by the garbage collector in the .NET runtime that the DNS server is running on. When the DNS server starts, there are many processes that run like loading the block lists which consume memory. The memory you see used will get freed automatically after a while as the garbage collector runs and de-allocate things that are not in use anymore. Another thing, the max cache size you have is very low and using the default value of 10,000 is recommended. The records do not take that much memory and the server can easily hold even more than 10k records on a server with 1GB RAM. Low max cache size will cause the DNS server to remove usable records and will cause it to fetch them again and again when it receives requests, decreasing the overall performance. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the explanation, @ShreyasZare. For the moment, what I see is this:
That is still a bit higher (~15 MB) than the sum for the 2 instances with the older version. |
Beta Was this translation helpful? Give feedback.
For programs developed in C/C++, for example, can precisely answer such questions. Memory usage pattern is not predictable with runtimes that use garbage collection.