microsoft / azuredatastudio

Azure Data Studio is a data management and development tool with connectivity to popular cloud and on-premises databases. Azure Data Studio supports Windows, macOS, and Linux, with immediate capability to connect to Azure SQL and SQL Server. Browse the extension library for more database support options including MySQL, PostgreSQL, and MongoDB.
https://learn.microsoft.com/sql/azure-data-studio
MIT License
7.54k stars 896 forks source link

Any operation is super slow #25340

Open jtsom opened 6 months ago

jtsom commented 6 months ago

Type: Bug

Trying to do any operation, to any database, either local, or through a VPN to our Azure databases, is super slow.

It is taking 30 - 60 seconds just to open the database server in the server explorer, or executing any statement.

Opening a connection to a database server also takes 30 seconds to multiple minutes.

Something happened in a recent update to cause this SUPER slow down.

Azure Data Studio version: azuredatastudio-insiders 1.48.0-insider (8a715ed3b1e87153e46651b920367170564eb376, 2024-02-15T12:58:00.069Z) OS version: Windows_NT x64 10.0.22631 Restricted Mode: No Preview Features: Enabled Modes:

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i5-8500 CPU @ 3.00GHz (6 x 3000)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled| |Load (avg)|undefined| |Memory (System)|31.78GB (16.34GB free)| |Process Argv|| |Screen Reader|no| |VM|0%|
Extensions (6) Extension|Author (truncated)|Version ---|---|--- dacpac|Mic|1.14.0 import|Mic|1.6.0 schema-compare|Mic|1.21.0 ADS-add-columns|sof|0.0.12 vscodeintellicode|Vis|1.2.1 poor-sql-formatter|WSR|0.1.0
cheenamalhotra commented 6 months ago

Can you please share logs we can investigate when you notice a slowdown?

github-actions[bot] commented 6 months ago

We need more info to debug your particular issue. If you could attach your logs to the issue (ensure no private data is in them), it would help us fix the issue much faster.

  1. First open the Settings page, find the Mssql: Tracing Level setting and change that to All then restart Azure Data Studio.
  2. Open command palette (Click View -> Command Palette) and run the command Developer: Set Log Level... and set the level to Trace.
  3. Run the repro scenarios.
  4. Collect the following logs:

    Console Logs

    • Open Developer Tools (Help -> Toggle Developer Tools)
    • Click the Console tab
    • Click in the log area and select all text (CTRL+A)
    • Save this text into a file named console.log and attach it to this issue.
    • Developer Tools can be closed via Help -> Toggle Developer Tools

    Application Logs

    • Open command palette (Click View -> Command Palette)
    • Run the command: Developer: Open Logs Folder
    • This will open the log folder locally. Please zip up this folder and attach it to the issue.
  5. Now you can revert the Log/Tracing levels changes made in step 1 and step 2.
jtsom commented 6 months ago

Here you go.

console.log 20240220T084459.zip

cheenamalhotra commented 6 months ago

I believe you accidentally closed the issue.. reopening it. Also the logs don't contain any MSSQL logs, can you recheck you've enabled them as per above instructions and restarted ADS?

jtsom commented 6 months ago

Trying again.

cheenamalhotra commented 6 months ago

Thanks! I've gathered the logs, removed from comment above to remove server info.

cheenamalhotra commented 6 months ago

From the logs, I can notice a delay of 20+ seconds on every connection during login in the SqlClient library, e.g.

24-02-20 11:20:55.7865597 pid:19624 tid:16 sqltools Verbose: 0 : eventTID:25784 <prov.DbConnectionHelper.ConnectionString_Set|API> 1, 'Data Source=<org.fqdn.com>;Initial Catalog=<database>;User ID=<username>;Connect Timeout=60;Encrypt=True;Trust Server Certificate=True;Authentication=SqlPassword;Application Name=azdata;Connect Retry Count=1;Connect Retry Interval=10;Command Timeout=30'
24-02-20 11:20:55.8226544 pid:19624 tid:16 sqltools Verbose: 0 : eventTID:25784 SqlConnection.OpenAsyncRetry | Info | Object Id 1
<async connection open>
24-02-20 11:20:55.9181035 pid:19624 tid:18 sqltools Verbose: 0 : eventTID:12176 TdsParser.Connect | SEC | Connection Object Id 4, Authentication Mode: SqlPassword
24-02-20 11:21:17.0460890 pid:19624 tid:18 sqltools Verbose: 0 : eventTID:12176 <sc.TdsParser.Connect|SEC> Sending prelogin handshake

We will investigate and get back to you.

jtsom commented 6 months ago

Yep that's pretty much what happens. Happening lately on connections to my local sql server, and more severely when trying to connect to our Azure Sql database, through our VPN (which is what I did in this test.)

Thanks.

cheenamalhotra commented 6 months ago

Could you try to resolve server IP address (using nslookup {hostname} and connect to IP address directly? This will help identify if this is related to DNS service.

jtsom commented 5 months ago

Stil having MASSIVE slowness when going through an Azure VPN:

When connecting through an Azure VPN connection, to an Azure hosted database, ADS takes forever to connect - if it connects at all. Trying to twist open a database connection in the Connections pane most times takes several minutes (10+?) or never opens up at all.

Using SSMS, I am able to connect right up to the same database, almost instantly.

I tried getting the IP address, but nslookup reports it cannot find the server - even though SSMS, using the same hostname, works just fine.