简体   繁体   中英

SQL Server Slow after debugging website in Visual Studio

When I use Visual Studio 2015 to debug a website, using file -> open website... on my local development database, queries slows right down to the point where they take a minute or more instead of milliseconds. Similar queries run by hand using SQL Server Management Studio (SSMS) are slow while Visual Studio is running.

SQL Server instance is running on the same machine as Visual Studio environment.

Here is what I've tried:

  1. Stop Debug mode
  2. After stopping debug, kill IIS Express process
  3. Disabled IntelliTrace
  4. Close solution in Visual Studio

The issue still persists after the above, and the problem is resolved when Visual Studio is shut down or a different solution is opened.

I checked the sql connections from SSMS and the connections were cleared once IIS Express process. It appears to be some sort of integration that Visual Studio is instrumenting with SQL Server libraries that is at the root of this.

Anybody have an idea what this might be or how to troubleshoot this further?

This issue was memory related. If the host that runs SQL server is strained for memory, SQL server will still operate but will bog right down to the point of being essentially inoperable.

My solution was to upgrade my system so that I had a ton of RAM and gave the VM running SQL server and Visual Studio tons of ram. This has the unfortunate side effect of taking for ever to suspend the VM but at least its SQL server is usable with Visual Studio.

I still don't know how to detect by looking at SQL statistics or process monitors. I guess I may need to find/open a new question to drill into this.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM