Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Service Host: DNS Client uses > 50% CPU and block for min 5min the net #757

Closed
AngelTs opened this issue Aug 15, 2018 · 5 comments
Closed

Comments

@AngelTs
Copy link

AngelTs commented Aug 15, 2018

From a few months from now, host file under Win10 Pro 64bit 1803 17134.191 is the reason "DNS Client" (svchost.exe) to use 50-55% of CPU each time when the internet is activated. Also to block the internet for at least 5min during this process!
Obvious, it is bug of DNS Client, but this bug is not exist in early versions of host file (2017>).
So I am wonder, is it possible some host name(s) in host file to rise this bug?
Anybody to feel the same f..g problem?

@funilrys
Copy link
Contributor

Duplicate of #710 ?

@AngelTs
Copy link
Author

AngelTs commented Aug 15, 2018

in #710 they discuss the host file size. I don't think this is the real problem, because just few months ago everything works fine with almost the same file host size- the real problem is in some strings as host names or ip addresses

@ScriptTiger
Copy link
Contributor

Some similar issues are here:
https://github.com/ScriptTiger/Unified-Hosts-AutoUpdate/issues?utf8=%E2%9C%93&q=compressed

The problem is not directly the file size, but the line count. It has to do with how the DNS Client service parses the file. The solution is to use a compressed file format.

If you use the AutoUpdate script, it gives you a compression level option when you set it up and it can automatically update your hosts file with the chosen compression level every time Steven pushes an update:
https://github.com/ScriptTiger/Unified-Hosts-AutoUpdate

If you would prefer to do things manually, you can try either the compressed or mcompressed formats here:
https://scripttiger.github.io/alts/

If you would like to generate your own hosts file from scratch using Steven's script, Steven's readme suggests the following:

--compress, or -c: false (default) or true, Compress the hosts file ignoring non-necessary lines (empty lines and comments) and putting multiple domains in each line. Reducing the number of lines of the hosts file improves the performances under Windows (with DNS Client service enabled).

@AngelTs
Copy link
Author

AngelTs commented Aug 19, 2018

@ScriptTiger Thank you so much for your perfect resolution. This is the right one- I just put "-c" in "python updateHostsFile.py … -c ..." and everything works like a charm, without delay or high CPU usage.
Thank you again for your perfect work.

@AngelTs AngelTs closed this as completed Aug 19, 2018
@ScriptTiger
Copy link
Contributor

ScriptTiger commented Aug 19, 2018

@StevenBlack, I'm not sure if adding the -c switch to the updateHostsWindows.bat or just adding a bold/highlighted note to Windows users in the readme_template.md would be best, but addressing this would definitely solve most issues Windows users have. It can even cause seemingly unrelated networking issues by jamming up networking services and many people don't think to try this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants