azuredatastudio icon indicating copy to clipboard operation
azuredatastudio copied to clipboard

Azure Data studio operations are very very slow and even not responds most of the time

Open rkrgithub opened this issue 2 years ago • 39 comments

Azure Data studio operations are very very slow and even not responds most of the time. For example connecting to local sql server takes ages. Right click on database tables do not show the selection and when select the items in the context menu, it does not show any progress which will give confusion like is it working or not. It is not doing the operations even after wait for some time. I noticed after 5 minutes or so suddently it open different tabs as part of earlier above operations. Earlier versions were better in performance and thats why instead of using SSMS, started using this ADS.

Version: 1.34.0 (user setup) Commit: 83a4316cf89cbf961a0f09a72c861379cfd01fa9 Date: 2021-12-15T20:47:33.863Z VS Code: 1.58.0 Electron: 12.0.9 Chrome: 89.0.4389.128 Node.js: 14.16.0 V8: 8.9.255.25-electron.0 OS: Windows_NT x64 10.0.19044

rkrgithub avatar Feb 22 '22 21:02 rkrgithub

We need more info to debug your Azure Active Directory 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.

  • In the settings menu, find the setting titled Azure: Logging Level and select the Verbose option
  • Run the process that produces your error
  • Open command palette (Click View -> Command Palette)
  • Run the command: Developer: Open Logs Folder
  • Follow this path to find the Azure Accounts log file: [default log folder]/exthost1/output_logging_[earliest timestamp]/#-Azure Acounts.log
  • Please attach the Azure-Accounts.log file to the issue.

github-actions[bot] avatar Mar 22 '22 18:03 github-actions[bot]

Hi, I have the same issue. I followed the logging instructions, and I also set Mssql tracing level to verbose. The requested log is empty, as are most other log files. Only renderer1.log gets updates (attached)

Menu was clicked around 11:24, UI reacted around 11:27.

renderer1.log

Even at verbose it doesn't log much when things are working fine either...

VulumeCode avatar Apr 01 '22 09:04 VulumeCode

@VulumeCode many connection related actions are performed async. If those communications take a long-time then there can be some delay between a UI action and the UI response (though it should not ever be 3 minutes). We can look at providing better UI updates so users know what is happening but the overall time would be the same in that case (as the delay is communicating with the server).

The other place we see UI delays is right after starting ADS while background services are loading. During that time UI commands are buffered and then dispatched once the app is fully loaded. This can take a while on particular machine configurations (like VMs with 1 or 2 cores or systems without enough free memory available).

If you're able to provide more specific detail about the delays your seeing it may help us to better understand/repro what you're seeing. The delay you've mentioned is well beyond what we'd expect to see.

kburtram avatar Apr 05 '22 20:04 kburtram

Here is the video captured when connecting to a local database using ADS. First time it is taking more time to connect to the server. It was not connecting. Then I closed the ADS and opened again. That time it connected to DB and tables fast. When I logged this issue, that time for every operation it was taking ages. Now it looks like improved. (But definitely not the same performance as I used this tool 6 months back)

Open ADS all of a sudden video below, https://user-images.githubusercontent.com/6441580/161862335-eae036f0-9166-438c-a8c2-e0f8b39d3ded.mp4

After Machine restart, video below, https://user-images.githubusercontent.com/6441580/161864197-895c5249-d586-43e1-b855-bece3558409f.mp4

Without Machine restart, restart ADS, video below https://user-images.githubusercontent.com/6441580/161864854-8a200600-1dbf-44b0-a3cd-3914f3ee8fb1.mp4

rkrgithub avatar Apr 05 '22 22:04 rkrgithub

@kburtram The delays happen usually after ADS has been open for a while. Restarting ADS usually (not always) fixes the delays. The database has to reconnect of course but that's acceptable.

It does appear that system memory is an issue. It is consistently extremely slow when memory usage is over 90% (of 16GB). Nevertheless, in the time that it takes to complete I can start up MS SQL Server Management Studio and perform the same task smoothly.

When memory usage drops below 90% ADS becomes fast again.

Is there some throttling mechanism?

VulumeCode avatar Apr 08 '22 09:04 VulumeCode

We need more info to debug your Azure Active Directory 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.

  • In the settings menu, find the setting titled Azure: Logging Level and select the Verbose option
  • Run the process that produces your error
  • Open command palette (Click View -> Command Palette)
  • Run the command: Developer: Open Logs Folder
  • Follow this path to find the Azure Accounts log file: [default log folder]/exthost1/output_logging_[earliest timestamp]/#-Azure Acounts.log
  • Please attach the Azure-Accounts.log file to the issue.

switched to "Verbose" option helped, thank you very much

karol1999 avatar Aug 17 '22 16:08 karol1999

Working with Azure Data Studio 1.40.0. Running a simple query that returns a single row from the server is taking at times 45 seconds or more.

My machine is an AMD Ryzen 9 5900X with a GeForce 3080 Ti, Windows 10 Pro 21H2 64 bit, and 64 GB of RAM.

stephajn avatar Nov 16 '22 23:11 stephajn

Same problem here :(

betorolim1 avatar Nov 18 '22 11:11 betorolim1

I am facing the same issue. During a simple select current_user Executing query... message is displayed in the status bar forever

msmosso avatar Nov 18 '22 17:11 msmosso

Same issue... Tried reinstalling but no luck. My other laptop with the same application version works fine. At the moment I am using SSMS instead :(

namj avatar Dec 01 '22 02:12 namj

I've got the same issue after a clean install of my laptop. Worked perfectly before, now it's pretty much unusable. A query that takes 0 seconds in SSMS takes about 10 seconds in ADS. It's a really simple query running against an Azure SQL Server. It takes about 4 seconds for an emptpy grid to appear and another 3-4 seconds before the grid is populated with query results.

mickefilen avatar Dec 19 '22 06:12 mickefilen

I've been seeing this same issue for some time on my M1 Mac (both on Intel and native builds of ADS). I followed the verbose logging steps outlined above, and have attached the log.

I connected to an Azure SQL Database instance and ran "SELECT @@ SPID;" over a moderately slow connection with 250-300 ms roundtrip latency. I used SQL Server authentication to connect to the instance.

Log (Window).log

Additionally, the "Azure Accounts" log produced this single line:

[Error]: Account was stale. No tokens being fetched. - []

.. though I'm not sure if this is related to the problem.

The problem appears to be related to network connectivity - it happens much more frequently and is much more pronounced when I'm on a VPN or a mobile connection.

For what it's worth, it looks to me like the "access token expired" message happens when I click "run" on the query. Once the query executes - and the empty grid appears - there's a new "access token expired" message. So it appears like it's connecting once to run the query (and getting the metadata?) and then connects again to retrieve the results.

Version: 1.40.1 Commit: 3a32679ab590c1023ab4de6f191769e7e127d25b Date: 2022-11-22T18:22:25.529Z (4 wks ago) VS Code: 1.67.0 Electron: 17.4.11 Chromium: 98.0.4758.141 Node.js: 16.13.0 V8: 9.8.177.14-electron.0 OS: Darwin arm64 22.1.0

dhmacher avatar Dec 21 '22 08:12 dhmacher

Very slow for SQL query on Mac. It runs fast for the first query. It runs very very slow for the second query. SSMS is much faster

justlearntutors avatar Jan 03 '23 14:01 justlearntutors

any alternatives for mac? really slow queries since I've started using

ariel-stage avatar Jan 15 '23 22:01 ariel-stage

Since yesterday, I experience very poor performance for Notebooks. Even Saving the notebook tooks more than 10 seconds, often up to 30 seconds. Starting a query step the same. It feels like working in honey. Hoped it would have gone away this morning. But it is the same with a fresh started system. Working via VPN connectio to client site on Azure SQL. But that worked like a charm until recently. Standard queries are normal. Version: 1.41.1 (user setup) Commit: 33dce95b152227c4f10f6251ab30690fe9895c0c Date: 2023-01-28T00:46:39.274Z VS Code: 1.67.0 Electron: 19.1.8 Chromium: 102.0.5005.167 Node.js: 16.14.2 V8: 10.2.154.15-electron.0 OS: Windows_NT x64 10.0.22621

matthhias avatar Feb 02 '23 07:02 matthhias

Same issue as generally described above. Sometimes a query that took 2 secs or less in SSMS appears to "hang" when ran in ADS and I have to disconnect and reconnect the connection. Almost as if some tabs are successfully connecting to the database while others are not. Very annoying and is pushing me back to SSMS.

Version: 1.41.2 (system setup) Commit: 0f0960d0e774e1ce903b79378addff96117c27a6 Date: 2023-02-08T20:16:49.071Z VS Code: 1.67.0 Electron: 19.1.8 Chromium: 102.0.5005.167 Node.js: 16.14.2 V8: 10.2.154.15-electron.0 OS: Windows_NT x64 10.0.19045

I will attempt to capture some logging of this issue and share back.

claytonjhamilton avatar Feb 17 '23 15:02 claytonjhamilton

Just to say I'm having this issue as well. Restarting the app seems to fix it, for awhile. 2019-era MacBook Pro.

I need a solution and others I think already provided the data needed. This bug is so serious the app is basically unusable.

#following

bbirtle avatar Feb 28 '23 04:02 bbirtle

I have a similar problem. It appears to be b/c I have connections to azure machines. If I remove the connections, the queries to my the local SQL server give a normal response. If I add the azure server connections back, even though they are not opened, my queries to the local SQL take minutes

Dovernh avatar Feb 28 '23 13:02 Dovernh

Same problem here, work connected on 2 different databases; I noticed a few things in ADS compared to SSMS;

1 - When I work in multiple banks: ADS simply hangs, and does not execute anything else, I have to restart the application vs in SSMS the same use, the same queries, they run normally;

2 - Result time: ADS takes two or three times longer than SSMS to bring the data and fill the table; When updating, inserting or dropping (IDEM), ADS always has slower processing than SSMS;

3 - Itellisense features: ADS is slower than SSMS, and sometimes it takes so long that it doesn't work, it simply gets lost in the auto complete;

WHY am I TRYING to use ADS;

  1. Multiplatform, (I'm trying to migrate to macos, weight, performance, portability issues);
  2. Plugins and integrated tools, such as GIT, Sanddance, etc... that facilitate my daily work, in documentation, code updating, among others;
  3. Dark theme, functional SSMS dark theme is simply not an option;

alissoneloi avatar Mar 15 '23 12:03 alissoneloi

Additionally tagging QE since most of the comments are talking about executing query performance.

cheenamalhotra avatar Jun 12 '23 18:06 cheenamalhotra

Same problem here since I installed ADS on my MacOS (Ventura 13.2).

Version: 1.44.1 (Universal) Commit: 8f53a316fa00a98264f1ab119641cd540b5af25c Date: 2023-06-01T02:13:21.084Z (1 wk ago) VS Code: 1.70.0 Electron: 19.1.8 Chromium: 102.0.5005.167 Node.js: 16.14.2 V8: 10.2.154.15-electron.0 OS: Darwin arm64 22.5.0

Any query run very slowly for any of my databases. Testing the same queries and databases runs instantly on SSMS (for windows).

mayconfsbrito avatar Jun 14 '23 16:06 mayconfsbrito

I experience the same issue. After a few query runs ADS becomes unusable - just seems to hang. The same query executes quickly when I close and re-open ADS.

I tried using ADS a few years ago and gave up because of this issue, but am trying again because it is easier to use than SSMS. But I can't use it if this issue isn't solved.

I'm running Windows 11 on a 4 GHz machine with 32Gb of RAM (only using ~20gb when ADS becomes unstable).

joshbowdoin avatar Sep 04 '23 13:09 joshbowdoin

Trying to connect to an Azure database, through an Azure VPN, and any operations take an overly long amount of time. Opening a connection - 2min+, trying to click the disclosure arrow in the server browser, to browse the database - 2min+.

Got much worse with the latest Insiders version:

Version: 1.47.0-insider (user setup) Commit: 41e7569fdecf41693a7b8eb624809262e5c5f7c8 Date: 2023-09-12T05:30:38.760Z VS Code: 1.79.2 Electron: 22.3.14 Chromium: 108.0.5359.215 Node.js: 16.17.1 V8: 10.8.168.25-electron.0 OS: Windows_NT x64 10.0.22621

No errors in dev console

jtsom avatar Sep 12 '23 14:09 jtsom

After a couple insiders updates, this issue is still occurring. Even just twisting open the server in the server explorer takes an exceeding long time - upwards of 5 minutes.

Latest version: Version: 1.47.0-insider (user setup) Commit: a63463e35bb21bb89250be09d9639ff440c83b39 Date: 2023-09-21T05:45:55.537Z VS Code: 1.79.2 Electron: 22.3.14 Chromium: 108.0.5359.215 Node.js: 16.17.1 V8: 10.8.168.25-electron.0 OS: Windows_NT x64 10.0.22621

jtsom avatar Sep 22 '23 17:09 jtsom

Can you keep capturing Verbose logs and upload MSSQL.log for the event when delay occurs? The log file captures enough details for us to look deeper. It would be interesting to see where the delay happens.

cheenamalhotra avatar Sep 22 '23 23:09 cheenamalhotra

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.
  1. Now you can revert the Log/Tracing levels changes made in step 1 and step 2.

github-actions[bot] avatar Sep 22 '23 23:09 github-actions[bot]

This problem happens here too, it has always happened, I use it on a Mac M1, with the model's maximum memory, everything is perfect with the machine.

But in Studio it is very slow, and without explanation. Sometimes you call a simple query, and it takes 1 minute to start the query, something that a Windows with zero memory and which here next door, on the same network, executes instantly with SMSQL on Windows. This delay never happens on Windows, only in Studio. It takes a long time at the beginning of everything, it stays kind of "frozen" for a long time until the query itself is executed. And other times, it's instantaneous. It has no defined logic. I believe with so many reports above, they must already have the real reasons, they should perhaps make it clearer what happens, perhaps a tip to immediately resolve this, for example: disable intellisense and this will solve it in 99% of cases (just an example).

jonasrotilli avatar Nov 13 '23 18:11 jonasrotilli

Esse problema acontece aqui também, sempre aconteceu, eu uso em um Mac M1, com memória máxima do modelo, está tudo perfeito com a máquina.

Mas no Studio é muito lento e sem explicação. Às vezes você chama uma consulta simples, e demora 1 minuto para iniciar a consulta, coisa que um Windows com memória zero e que aqui ao lado, na mesma rede, executa instantaneamente com SMSQL no Windows. Esse atraso nunca acontece no Windows, apenas no Studio. Demora muito no início de tudo, fica meio "congelado" por muito tempo até que a consulta em si seja executada. E outras vezes, é instantâneo. Não tem lógica definida. Acredito que com tantos relatos acima, eles já devem ter os reais motivos, talvez devessem deixar mais claro o que acontece, talvez uma dica para resolver isso imediatamente, por exemplo: desative o intellisense e isso resolverá em 99% dos casos (só um exemplo).

This problem happens here too, it has always happened, I use it on a Mac M1, with the model's maximum memory, everything is perfect with the machine.

But in Studio it is very slow, and without explanation. Sometimes you call a simple query, and it takes 1 minute to start the query, something that a Windows with zero memory and which here next door, on the same network, executes instantly with SMSQL on Windows. This delay never happens on Windows, only in Studio. It takes a long time at the beginning of everything, it stays kind of "frozen" for a long time until the query itself is executed. And other times, it's instantaneous. It has no defined logic. I believe with so many reports above, they must already have the real reasons, they should perhaps make it clearer what happens, perhaps a tip to immediately resolve this, for example: disable intellisense and this will solve it in 99% of cases (just an example).

To complement, I'm using the latest version, from November, no improvements in this version to the problem happened. The current version here is: 1.47.0

jonasrotilli avatar Nov 13 '23 20:11 jonasrotilli

I've been using ADS since the first versions that shipped with SSMS, and I love it overal. But these issues make it very hard sometimes to do my work smoothly...

As many have said, I also experience the following issues:

  • Very slow connection time to a database, even if ADS has been open for a longer time
  • When the database is connected and using the New query command, it opens a new tab, but does not connect to the database until some time later (or not at all)
  • Starting a query sometimes takes a full minute (not the query itself, as it might be 1 ms)
    • Additionally while this is ongoing, I also can't cancel the query... Any UI commands are frozen and only work after the query has finally started
  • Intellisense drops out frequently and takes sometimes up to a minute to get back
    • Again, while this is ongoing, many UI commands fail to start until Intellisense gets back
  • Trying to copy a value from the query results, sometimes takes ages
    • To add (1): In the latest version(s), they've visualised the progress as a notification, so I definitely know how long it takes now
    • (2): I can queue MANY copy commands, and all of them will complete at once when the first one is completed
  • A big one: If you have a query result with a large number of columns (so having to scroll horizontally), if you scroll to quickly, it might crash ADS... Having to do large queries like that again is a pain!

QuickScoP3s avatar Dec 12 '23 10:12 QuickScoP3s

For users on macOS, you may be experiencing hostname resolution issues from mDNSresponder with target SQL server, for reference: https://github.com/dotnet/SqlClient/issues/2221. This can cause ADS to appear extremely slow as numerous connections are made by the tool for different reasons.

For a quick test, try using IP Address or FQDN domain name for the target server and you should notice faster connection time.

If this applies to you, I would recommend updating /etc/hosts file to include an entry for your target server, e.g.

192.168.1.1    SQL2022    SQL2022.corp.org.com

Additional references from https://github.com/dotnet/SqlClient/issues/2221#issuecomment-1821546582:

  • https://stackoverflow.com/questions/44760633
  • https://serverfault.com/questions/286185

cheenamalhotra avatar Dec 12 '23 18:12 cheenamalhotra