Sessions refers to the number of concurrent connections allowed to a SQL database at a time. Workers can be thought of as the processes in the SQL database that are processing queries. The maximum number of sessions and workers allowed depends on your databases’s service tier. Blue Matador monitors the sessions_percent and workers_percent metrics so you can know when you’ve hit the limit.



    When the sessions limit is reached, additional connections to the database will be rejected. When the worker limit is reached, clients will receive an error message and will be unable to query your database.



    The two possible fixes for reaching the maximum number of sessions: reduce the amount of sessions used by your application, or increase the service tier for your database so there is a higher limit. If your application is using connection pooling, you can configure it so that idle connections are terminated, and limit the number of connections allowed by your application to prevent hitting the limit.

    You can also refer to the sys.dm_exec_sessions and sys.dm_exec_connections tables to view the current sessions and connections to figure out where the most sessions are used.

    The number of used workers is harder to control since it is not directly tied to the number of sessions. Worker usage can go up during high-usage periods since backed-up queries will consume workers. If you have high worker usage but not session usage, you can use Query Store to analyze your queries to see if specific ones are causing high worker usage.

    If you decide to upgrade your database, consult the service tier limits can be found on the following pages to choose an appropriate tier for your session and worker requirements: