{"id":1000,"date":"2017-10-18T14:50:57","date_gmt":"2017-10-18T12:50:57","guid":{"rendered":"http:\/\/dety.net.ua\/?p=1000"},"modified":"2017-10-18T14:50:57","modified_gmt":"2017-10-18T12:50:57","slug":"dns-server-memory-consumption","status":"publish","type":"post","link":"https:\/\/dety.net.ua\/?p=1000","title":{"rendered":"DNS server + memory consumption"},"content":{"rendered":"<p>In Windows Server 2008 R2 or older OS with <a href=\"http:\/\/www.microsoft.com\/technet\/security\/Bulletin\/MS08-037.mspx\">MS08-037<\/a> patch installed, DNS server (<span class=\"skimlinks-unlinked\">dns.exe<\/span>) consumes ridiculously large amount of precious memory.<\/p>\n<p>Under the hood, <span class=\"skimlinks-unlinked\">dns.exe<\/span> opens more than 5000 UDP ports during start up, 2500 for UDP IPv4, 2500 for UDP IPv6.\u00a0 Large amount of kernel\u00a0memory is also allocated for these ports.\u00a0 This can get even worse when increasing the number of CPU cores on the system.\u00a0 200MB consumption on a 4 cores system is fairly common.\u00a0 wtf!!<\/p>\n<p>One of the workaround is to reduce the value one called SocketPoolSize, which may\u00a0potentially increase the security attack surface.\u00a0 The default value for SocketPoolSize is 2500.\u00a0 Set to 10 may be good for lightweight DNS server used behind the firewall.<\/p>\n<p>Following command can read\/set the value<\/p>\n<p>Dnscmd\u00a0\/Info \/SocketPoolSize<\/p>\n<p>Dnscmd\u00a0\/Config\u00a0\/SocketPoolSize 10<\/p>\n<p>After restart the DNS service, the memory consumption goes down to an acceptable 10MB range.<\/p>\n<p>Source: <a href=\"https:\/\/pigworlds.wordpress.com\/2011\/04\/15\/anonying-dns-exe-high-memory-consumption\/\">https:\/\/pigworlds.wordpress.com\/2011\/04\/15\/anonying-dns-exe-high-memory-consumption\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In Windows Server 2008 R2 or older OS with MS08-037 patch installed, DNS server (dns.exe) consumes ridiculously large amount of precious memory. Under the hood, dns.exe opens more than 5000 UDP ports during start up, 2500 for UDP IPv4, 2500 for UDP IPv6.\u00a0 Large amount of kernel\u00a0memory is also allocated for these ports.\u00a0 This can [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13,12],"tags":[],"class_list":["post-1000","post","type-post","status-publish","format-standard","hentry","category-novosti","category-windows"],"_links":{"self":[{"href":"https:\/\/dety.net.ua\/index.php?rest_route=\/wp\/v2\/posts\/1000","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dety.net.ua\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dety.net.ua\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dety.net.ua\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dety.net.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1000"}],"version-history":[{"count":1,"href":"https:\/\/dety.net.ua\/index.php?rest_route=\/wp\/v2\/posts\/1000\/revisions"}],"predecessor-version":[{"id":1001,"href":"https:\/\/dety.net.ua\/index.php?rest_route=\/wp\/v2\/posts\/1000\/revisions\/1001"}],"wp:attachment":[{"href":"https:\/\/dety.net.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1000"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dety.net.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1000"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dety.net.ua\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1000"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}