crc-org / crc

CRC is a tool to help you run containers. It manages a local OpenShift 4.x cluster, Microshift or a Podman VM optimized for testing and development purposes
https://crc.dev
Apache License 2.0
1.26k stars 241 forks source link

[BUG] DNS resolution is very slow on Windows 10 2004 while CRC is running. #1352

Open bavibm opened 4 years ago

bavibm commented 4 years ago

General information

Very straight forward issue here and I've seen a lot of people post similar issues on GitHub and in public articles.

Whenever I start running CRC on Windows 10 2004 my DNS resolution becomes very slow. The easiest way to see it is to not run CRC and start browsing the web, see how fast the pages and dynamic content load. Pages and dynamic content would load near instantly, but once I start CRC everything takes several seconds.

I did some searching and found that tweaking the network metric on my primary adapter to a higher priority does solve this issue, sort of. It makes resolution for things outside of my local network normal speed again, but then the CRC name resolution becomes very slow. This is apparent because loading the CRC web console and all of its components takes a while, where it use to work instantly.

I do not have any of my VPNs you might see in the Host Information running, just in case that comes up.

UPDATE: Gist for crc start --log-level debug https://gist.github.com/bavibm/55c988a5f2c57ccf0632f43314807c06

CRC version

CodeReady Containers version: 1.12.0+6710aff
OpenShift version: 4.4.8 (embedded in binary)

CRC status

DEBU CodeReady Containers version: 1.12.0+6710aff
DEBU OpenShift version: 4.4.8 (embedded in binary)
CRC VM:          Stopped
OpenShift:       Stopped
Disk Usage:      0B of 0B (Inside the CRC VM)
Cache Usage:     14.81GB
Cache Directory: C:\Users\BrandonVillagran\.crc\cache

CRC config

- cpus                                  : 4
- memory                                : 16384
- pull-secret-file                      : XXX

Host Operating System

Host Name:                 DESKTOP-BGH27OB
OS Name:                   Microsoft Windows 10 Enterprise
OS Version:                10.0.19041 N/A Build 19041
OS Manufacturer:           Microsoft Corporation
OS Configuration:          Standalone Workstation
OS Build Type:             Multiprocessor Free
Registered Owner:          Windows User
Registered Organization:
Product ID:                00330-80000-00000-AA827
Original Install Date:     6/29/2020, 12:41:21 PM
System Boot Time:          7/1/2020, 10:28:54 AM
System Manufacturer:       LENOVO
System Model:              20MAS17200
System Type:               x64-based PC
Processor(s):              1 Processor(s) Installed.
                           [01]: Intel64 Family 6 Model 158 Stepping 10 GenuineIntel ~2592 Mhz
BIOS Version:              LENOVO N2CET44W (1.27 ), 6/21/2019
Windows Directory:         C:\Windows
System Directory:          C:\Windows\system32
Boot Device:               \Device\HarddiskVolume1
System Locale:             en-us;English (United States)
Input Locale:              en-us;English (United States)
Time Zone:                 (UTC-05:00) Eastern Time (US & Canada)
Total Physical Memory:     32,476 MB
Available Physical Memory: 26,882 MB
Virtual Memory: Max Size:  37,596 MB
Virtual Memory: Available: 27,945 MB
Virtual Memory: In Use:    9,651 MB
Page File Location(s):     C:\pagefile.sys
Domain:                    WORKGROUP
Logon Server:              \\DESKTOP-BGH27OB
Hotfix(s):                 6 Hotfix(s) Installed.
                           [01]: KB4552925
                           [02]: KB4537759
                           [03]: KB4557968
                           [04]: KB4560366
                           [05]: KB4561600
                           [06]: KB4557957
Network Card(s):           6 NIC(s) Installed.
                           [01]: Intel(R) Wireless-AC 9560 160MHz
                                 Connection Name: Wi-Fi
                                 DHCP Enabled:    Yes
                                 DHCP Server:     192.168.0.1
                                 IP address(es)
                                 [01]: 192.168.0.15
                                 [02]: fe80::7c73:c0df:1030:f8c4
                           [02]: Intel(R) Ethernet Connection (7) I219-LM
                                 Connection Name: Ethernet
                                 Status:          Media disconnected
                           [03]: Cisco AnyConnect Secure Mobility Client Virtual Miniport Adapter for Windows x64
                                 Connection Name: Ethernet 2
                                 Status:          Hardware not present
                           [04]: Intel(R) I210 Gigabit Network Connection
                                 Connection Name: Ethernet 3
                                 Status:          Media disconnected
                           [05]: Hyper-V Virtual Ethernet Adapter
                                 Connection Name: vEthernet (Default Switch)
                                 DHCP Enabled:    No
                                 IP address(es)
                                 [01]: 172.29.96.1
                                 [02]: fe80::5c4d:af7b:cac2:1f5f
                           [06]: Check Point Virtual Network Adapter For Endpoint VPN Client
                                 Connection Name: Ethernet 4
                                 Status:          Media disconnected
Hyper-V Requirements:      A hypervisor has been detected. Features required for Hyper-V will not be displayed.

Steps to reproduce

Given my system info

  1. crc setup
  2. crc start
  3. Wait for completion of startup
  4. Try to browse web or do anything that requires DNS resolution

Expected

Web browsing is normal speed, DNS resolution is unimpacted.

Actual

Web browsing is very slow with pages taking a more than a few seconds to come up, DNS resolution seems to be negatively impacted

gbraad commented 4 years ago

Duplicate of #926

When this causes issues, consider following the steps in that issue to reset the DNS resolution, or run crc cleanup but this command does more that might not be wanted.

gbraad commented 4 years ago

https://github.com/code-ready/crc/issues/926#issuecomment-596322747

PS> Set-DNSClientServerAddress "vEthernet (Default Switch)" -ResetServerAddresses
gbraad commented 4 years ago

while CRC is running

Hmmm .... sorry, missed that point

bavibm commented 4 years ago

On the upside that was a fast response lol

bavibm commented 4 years ago

After I ran delete and cleanup, your PS command, and rebooted laptop it seems to be fine now. I have my network metrics for primary adapter set to 5, everything else is automatic.

However it does not seem to work while I have a VPN running, specifically my Check Point VPN. I can't even open the CRC web console while VPN is on.

Update: As soon as I turn off VPN web console will come up Update 2: Turned automatic network metrics back on for primary adapter and problem persists

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

gbraad commented 4 years ago

The cleanup command resolves this, so this is very likely related to the DNS server entries on the Default Switch: you can run the reset like: https://github.com/code-ready/crc/issues/1352#issuecomment-652499670 so you do not need to use the cleanup command.

Note: We are looking into an alternative for this, but at the moment I can't give a timeline for this.