Occasionally on one of my web servers svchost.exe
runs around 60-80% running the DNS Client Service. This is on a Windows 2008 Web Server machine (patched up all the way) handling around 10M page views a day and around 5M unique users monthly.
I sometimes see it running on one of two servers in my farm, while handling the same amount of traffic as the other machines so I think it might be okay to disable it... Keep in mind that a server affected by it running close to 90% CPU while the others at 15%.
Now I know it caches the name resolution data but does it need to do it at this expense? I did some research and there are split recommendations on this so here I am asking you guys :) Thanks!
Here are screenshots of the CPU utilization:
Disabling the dns client service will not disable dns lookups. The stack will still know how to do a dns lookup. Don't believe it? Try it.
Now, one possible cause of high dns query rates on your web server may be dns lookups related to logging of http requests. Disable logging of the client request source by dns name.
I hate suggesting this, but does the server exhibit the same problem after a restart, or does it just slowly degrade over time?
Ditto Peter Ivan's note about large hosts files causing the DnsCache service to eat up CPU.
Seems to be my stock answer these days, but have a nose at what's going on using Process Monitor.
I'd also consider moving DnsCache to its own SVCHOST instance (for testing / isolation):
Disabling the DNS client service is going to make the server completely unable to resolve any DNS queries at all. This is not a good idea, IMHO. For starters, that means at a minimum the server will not be able to do any Windows Updates. But also, almost everything any computer does that involves networking of any sort requires DNS queries in order to function properly.
Also, if your web application is communicating with other services or web sites, then it would stop functioning.
My guess is that the DNS client service activity is due to IIS Logging; try turning that off temporarily and see if that resolves it. If that's the case then you know where your real problem lies.
DNS Client Service serves mainly as a DNS cache as it's service name "DNS Cache" suggests. Turning it off can slow down DNS name resolution.
Common browsing experience shouldn't be harmed. But there might be some processes on your web servers which rely on DNS name resolution. Then their response times could raise only because of repeated DNS queries to your DNS authority.
In my experience, high CPU utilisation by DNS Client Service can be caused by big
hosts
file. Adding NICs or changing their settings can cause flushing of DNS Cache and then it's CPU usage goes up.