Share via


High RAM usage (up to 2GB) by Domain Name service

Question

Friday, August 16, 2019 2:52 PM

Good Morning Windows Experts,

Me with my collegues will appreciate any help with the following topic.

We have a machine with Windows Server 2016 Standard Edition up to date.

We saw that the Domain Name service, particularly the dns.exe process, uses 1,8GB of RAM. We observed similar behaviour on other systems, where the dns.exe process uses from 500MB up to 2GB.

What these systems have in common is that they all have a high number of cores.
As we can read on: docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/ee649174(v=ws.10)
It's normal behaviour for this service. The memory usage in the above documentation doesn't fit exactly to our case, however we observe that more cores the system has, more RAM is used by DNS.

We would like to know if there is any way to limit the Windows service to use only some of the cores.

We have already started the service manually with the command: cmd.exe /c start /affinity F "c:\Windows\system32\dns.exe"
and the process used much less memory.

Is there any more elegant way to start the service with only few cores?
Or maybe is it possible to solve the RAM usage problem another way?

Thank you for your help.

Tomasz Zygarlicki

All replies (7)

Monday, August 19, 2019 3:25 AM

Hi,

Thanks for posting in the forum.

Please right click dns.exe and click set affinity on Task Manager. Then you can choose which processors are allowed to run "dns.exe".

Note: If you reduce cores, maybe your DNS server will have lower performance when your server receive plenty of DNS queries.


Hope this can help you.

Best regards,

Hollis

Please remember to mark the replies as answers if they help and unmark them if they provide no help.
If you have feedback for TechNet Subscriber Support, contact [email protected].


Monday, August 19, 2019 8:01 AM

Hollis Huang, thank you for your feedback.

Your solution effectively reduces number of cores used to run the service,
however it seems that the process reserves the memory on start,
so setting the affinity once the process is run does not change its RAM usage.

When running cmd.exe /c start /affinity F "c:\Windows\system32\dns.exe",
when affinity is set from beginning, the RAM usage is actually reduced.

Is there a way to set the affinity before the process is started?

Thank you.


Monday, August 19, 2019 9:47 AM

Hi,

Do you mean when you restart service, the number of core will be restored?

Based on my experience, I can't find any way to solve it by windows. But there is a three party software can do it. If you want to keep settings forever, you can try it. The software name is Process Lasso. You can refer to the following link to download it.

https://bitsum.com/

Best regards,

Hollis

Please remember to mark the replies as answers if they help and unmark them if they provide no help.
If you have feedback for TechNet Subscriber Support, contact [email protected].


Monday, August 19, 2019 5:38 PM

Thank you Hollis,

Actually, our goal is to reduce the dns.exe process memory usage and changing the affinity was a way to achieve it, however it seems to impossible to do it Windows.

Do you know any other way to reduce the dns.exe process RAM usage?

Best regards,


Tuesday, August 20, 2019 8:41 AM

Hi,

Sorry for that I can't find any way to reduce RAM usage. I have tried three party software, but it can only change affinity. You can refer to the following link:

https://superuser.com/questions/1263090/is-it-possible-to-limit-the-memory-usage-of-a-particular-process-on-windows

If you think the memory usage is too high to affect other processes, I recommend you increase your memory, or add a DNS server to share DNS client query.

Best regards,

Hollis

Please remember to mark the replies as answers if they help and unmark them if they provide no help.
If you have feedback for TechNet Subscriber Support, contact [email protected].


Tuesday, August 20, 2019 6:56 PM

Hi Mr Tom,

find below my response: 

To decrease the number of open ports, run the following command. For an internal DNS, with about 20 people in the office 100 ports is more than enough:

Once the below command is executed, Restart DNS service - memory consumption should decrease

Dnscmd /Config /SocketPoolSize 100

To view how many port open, please run this command

Dnscmd /Info /SocketPoolSize

The main cause is because too many ports were opened for this reason the memory consumption is high.


Friday, August 23, 2019 7:31 AM

Hi,

Was your question resolved? Just want to confirm the current situations.

Best regards,

Hollis

Please remember to mark the replies as answers if they help and unmark them if they provide no help.
If you have feedback for TechNet Subscriber Support, contact [email protected].