Monitoring Synapse serverless SQL open connections
Scenario: Consider a scenario where you are trying to monitor the connections from other applications to serverless SQL. I hit this need while trying to understand how many connections opened I had coming from an application. Had I hit some kind of limitation on serverless SQL or not. Spoiler: There is no limit for connections on Synapse serverless SQL as you would find with a dedicated SQL pool (formerly SQL DW).
Here it goes how to find how many open connections you have very simply:
1) Open SSMS or Synapse Studio or Azure Data Studio whatever you prefer.
2) Connect to your Synapse serverless SQL endpoint. If you are not connecting from the Synapse Studio, you can find the endpoint on the Azure portal when checking your workspace overview details - Fig 1 Overview (yellow).
Fig 1 - Overview
3) Now let's check the active sessions and requests. Run the following queries and check the results. This query will expose the sessions and current requests from those sessions in a summarized way.
Another way to monitor is the next query that will summarize the connections per program, login, and database:
For example, as a result in my own environment I have the following for the second query - Fig 2 Query Results:
Fig. 2 Query results.
As a result, information such as SQL or AAD user, login, application, and hostname will be exposed. As also you may note the results of internal sessions related to the Medatasync service on Serverless. Medatasync does what the name implies sync the metadata with other components. This is internal and is not something a user has control over.
Summary: The dynamic managed views (DMVs) above provide you a way to check out the sessions and active requests from those open sessions open. When I used those DMVs to understand the requests I have coming from my application to serverless I could confirm there was no limitation on the open sessions as I mentioned before.
Following are some examples of possible scenarios to use this logic:
- Monitor Active connections
- Monitor users, applications, and hosts connected to the environment.
- Troubleshooting for a suspicious leak of connections can be applied in any scenario.
So for the possible question that you may have up to this point... But...Would that mean is there a hard limit on connections inside serverless?
The short answer is No. What must be considered for serverless is not a limited number of connections but the number of active running queries.
Considerations about the active running queries:
- The number of active sessions and requests would depend on the query complexity and amount of data scanned.
- I mean...As with any SQL, a serverless SQL pool could handle many different sessions that are executing lightweight queries or complex heavy queries consuming most of the resources while the other queries wait.
And this is documented as follows:
Check if there is a concurrent workload running on the serverless pool because the other queries might take the resources. In that case you might split the workload on multiple workspaces."
Self-help for serverless SQL pool
Note: Thanks to Sergio Fonseca, Silas Mendes, and Ali Saleh on the CSS teamwork side.
Liliam C Leme
UK Engineer
Published on:
Learn moreRelated posts
We're moving!
We’re moving to the Analytics on Azure Tech Community! All new Azure Synapse Analytics content will be published there. In the next few days a...
Upgrade to Azure Synapse runtimes for Apache Spark 3.4 & previous runtimes deprecation
It is important to stay ahead of the curve and keep services up to date. That's why we encourage all Azure Synapse customers with Apache ...
Interpreting Script activity output json with Azure Data Factory\Synapse analytics
Script activity in Azure Data Factory\ Synapse analytics is very helpful to run queries against data sources mentioned here in this document.&...
ADF\Synapse Analytics - Replace Columns names using Rule based mapping in Mapping data flows
In real time, the column names from source might not be uniform, some columns will have a space in it, some other columns will not. For exampl...
Synapse Connectivity Series Part #4 - Advanced network troubleshooting and network trace analysis
Continuing the series of this blog posts I would like to go more advanced on troubleshooting connectivity issues. I would like to thank also&n...
Boost your CICD automation for Synapse SQL Serverless by taking advantage of SSDT and SqlPackage CLI
Introduction Azure Synapse Analytics Serverless SQL is a query service mostly used over the data in your data lake, for data discovery,...
Metadata-Based Ingestion in Synapse with Delta Lake
Overview The crucial first step in any ETL (extract, transform, load) process or data engineering program is ingestion, w...
Missing Fields Added to Dedicated SQL pool Diagnostic Settings Logs
Over the past year, customers have informed the team there were a set of key columns missing in the standalone Dedicated SQL pools (formerly S...
Using Azure DevOps with Synapse Workspaces to create hot fixes in production environments
Have you ever deployed a release to production only to find out a bug has escaped your testing process and now users are being severely impact...
Azure Synapse MVP Corner - March 2023
About this blog series Microsoft Most Valuable Professionals, or MVPs, are technology experts who passionately share their knowledge with the ...