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 897 forks source link

Delay in start of query execution #25073

Open NeoMetric opened 9 months ago

NeoMetric commented 9 months ago

Type: Performance Issue

ADS sometimes takes too long to start the execution of the query.

This is the latency between step 4 and 5

  1. Connect to server .
  2. Write the query.
  3. Click on RUN.
  4. Bottom blue pane shows "Executing query".
  5. "started executing query" message comes up.
  6. Result is returned.

Findings:

  1. Sometimes the delay is in minutes

  2. Sometimes it doesn't show any progress messages for a prolonged period, at which point even the CANCEL button does not work, and the query tab need to be closed and a fresh session need to be started.

I have tested this while executing queries against Azure synapse Dedicated pool DW.

Azure Data Studio version: azuredatastudio 1.47.0 (c7c2b2f21505562d21972d4c135119d00806db4f, 2023-11-07T17:17:45.669Z) OS version: Windows_NT x64 10.0.19045 Restricted Mode: No Preview Features: Enabled Modes:

System Info |Item|Value| |---|---| |CPUs|11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz (8 x 2995)| |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)|15.71GB (2.33GB free)| |Process Argv|| |Screen Reader|no| |VM|0%|
Process Info ``` CPU % Mem MB PID Process 0 132 1480 azuredatastudio main 0 90 992 fileWatcher [1] 1 280 6660 gpu-process 0 101 14804 shared-process 0 132 15580 extensionHost [1] 0 29 6136 c:\Users\name\.azuredatastudio\extensions\microsoft.azuremonitor-0.1.9\sqltoolsservice\Windows\3.0.0-release.133\MicrosoftKustoServiceLayer.exe --locale en --log-file c:\Users\name\AppData\Roaming\azuredatastudio\logs\20231130T135908\window1\exthost\Microsoft.azuremonitor\azuremonitorService.log --service-name AzureMonitor 0 6 20176 C:\WINDOWS\system32\conhost.exe 0x4 0 245 7908 "c:\Program Files\Azure Data Studio\resources\app\extensions\mssql\sqltoolsservice\Windows\4.10.1.3\MicrosoftSqlToolsServiceLayer.exe" --application-name azuredatastudio --data-path C:\Users\name\AppData\Roaming --locale en --log-file c:\Users\name\AppData\Roaming\azuredatastudio\logs\20231130T135908\window1\exthost\Microsoft.mssql\sqltools.log --tracing-level Critical --autoflush-log --parallel-message-processing --parallel-message-processing-limit 100 --enable-sql-authentication-provider --enable-connection-pooling 0 6 4168 C:\WINDOWS\system32\conhost.exe 0x4 0 90 11456 "C:\Program Files\Azure Data Studio\azuredatastudio.exe" "c:\Program Files\Azure Data Studio\resources\app\extensions\json-language-features\server\dist\node\jsonServerMain" --node-ipc --clientProcessId=15580 0 33 25628 "c:\Program Files\Azure Data Studio\resources\app\extensions\mssql\sqltoolsservice\Windows\4.10.1.3\SqlToolsResourceProviderService.exe" --application-name azuredatastudio --data-path C:\Users\name\AppData\Roaming --locale en --log-file c:\Users\ChellMI\AppData\Roaming\azuredatastudio\logs\20231130T135908\window1\exthost\Microsoft.mssql\resourceprovider.log --tracing-level Critical --autoflush-log 0 6 11796 C:\WINDOWS\system32\conhost.exe 0x4 0 32 25944 "c:\Program Files\Azure Data Studio\resources\app\extensions\mssql\sqltoolsservice\Windows\4.10.1.3\MicrosoftSqlToolsCredentials.exe" --application-name azuredatastudio --data-path C:\Users\name\AppData\Roaming --locale en --log-file c:\Users\name\AppData\Roaming\azuredatastudio\logs\20231130T135908\window1\exthost\Microsoft.mssql\credentialstore.log --tracing-level Critical --autoflush-log 0 6 12180 C:\WINDOWS\system32\conhost.exe 0x4 0 83 20472 utility-network-service 0 260 20808 window [1] (service_account_creation.sql - server.database.windows.net.database (Name - email@address.com) - BAU (Workspace) - Azure Data Studio) 1 99 25048 window [2] (Issue Reporter) ```
Workspace Info ``` | Window (service_account_creation.sql - server.database.windows.net.database (Name - email@address.com) - BAU (Workspace) - Azure Data Studio) | Folder (SQL Scripts): 224 files | File types: sql(211) txt(7) sqlite(1) json(1) | Conf files: | Folder (L-box): 208 files | File types: sql(113) txt(11) json(9) ssms_suo(5) sqlite(4) sqlplan(3) | ipynb(2) ps1(2) ssmssqlproj(1) ssmssln(1) | Conf files:; ```
Extensions (14) Extension|Author (truncated)|Version ---|---|--- sql-data-inspector|ern|0.6.0 admin-pack|Mic|0.0.2 admin-tool-ext-win|Mic|0.1.3 agent|Mic|0.49.0 azuremonitor|Mic|0.1.9 dacpac|Mic|1.14.0 import|Mic|1.5.5 powershell|ms-|2023.2.1 profiler|Mic|0.14.0 query-history|Mic|0.5.3 schema-compare|Mic|1.21.0 sql-database-projects|Mic|1.4.1 sql-dw|Mic|0.0.1 vscode-icons|vsc|12.4.0
github-actions[bot] commented 9 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.
cheenamalhotra commented 9 months ago

Hi @MidhunCN

I would recommend capturing logs as per above and when you do encounter issue, please gather the same and upload here for investigation. Intermittent issues like these are tough nuts to crack without evident logs.

QuickScoP3s commented 6 months ago

I've seen this issue many times... A lot of these similar issues seem to stem from the "SQL Tools Service" taking a long time to start up