SQL Azure – Resource Limitations and Max Concurrent Sessions

azure-sql-databasesql server

I was trying to select a tier for our internal consumption and going through this limitations in detail..Azure SQL Database resource limits

One particular instance of trouble was below chart and particularly highlighted values

enter image description here

as you see ,from the highlighted ,there is a max concurrent limitation of 60 concurrent logins and 600 concurrent sessions

ASK:
a single query can go in parallel and can have multiple sessions,will those sessions count under this limitation ?

i tried to test this using Paul White's article Forcing a Parallel Query Execution Plan like below

DBCC FREEPROCCACHE
DBCC SETCPUWEIGHT(1000)

GO
-- Query to test  
some expensive query
GO

DBCC SETCPUWEIGHT(1)  
DBCC FREEPROCCACHE   

or using

OPTION (RECOMPILE, QUERYTRACEON 8649)

but i can only go upto 9 sessions,when i checked using below DMV

select * from sys.dm_os_tasks 
where session_id=61

and these trace flags and DBCC options wont work in azure .let me know if i am unclear

Best Answer

When a task goes parallel it is still considered a single session with multiple request.

Hopefully the following will clear you confusion about the 2 metrics. I

Ref: https://social.msdn.microsoft.com/Forums/en-US/c073c554-03a3-43b5-9052-4de63d1f44d7/logins-versus-sessions?forum=ssdsgetstarted

Lets say you have 10 developers working on your app and they all connect to Azure SQL using SSMS. They will create 10 concurrent logins and 10 sessions in Azure SQL.

Now let's say that your app is using one login for connecting to Azure SQL and you have 100 concurrent users on your app. This will create one concurrent login and 100 concurrent sessions in Azure SQL.

If you want to baseline your concurrent session this is a great article. You might have to tweak it for Azure SQL Database.