I’m in a case where my connection to the database server is very slow. Currently, I’m using SSMS to connect to it by IPAddress and Port.
The connection string looks like this: IP_address, portInstance name.
This takes about 10-12 seconds to connect, any actions such as expanding tables, querying, or just simply clicking would take the same amount of time.
If I follow these 2 methods, it connects super fast as if I were connecting to the local database.
- Adding these 2 into hosts file:
127.0.0.1 crl.microsoft.com
<IP address of db server> <random name>
- Or just simple connect to the server by format Servername,portInstanceName instead
ProServer,14494PRO_DEMO_S1
Additional information I think may help to troubleshoot this issue:
- DBServer and my computer are on 2 different VMs, connecting by RDP.
- Only my VMs connect to the DBServer, all were stopped for troubleshooting the issue.
- Connecting by using sqlcmd would have the same issue. 4-5 seconds with IPAddress, <1 second with the server name.
- The DB server is just freshly setup, there is no heavy query running.
- The DB Server is not overloaded, both CPU, Ram usage seem good.