Thread Count

Microsoft.SQLServer.Linux.Monitor.DBEngine.ThreadCount (UnitMonitor)

Thread Count for DB Engine

Knowledge Base article:


Usually SQL Server opens system thread for each query request, but if amount of threads exceeds specified max worker threads value, SQL Server pools the worker threads. When all worker threads are active with long running queries, SQL Server may appear unresponsive until a worker thread completes and becomes available. Though not a defect, this can sometimes be undesirable. The monitor analyzes amount of free threads and notifies if the amount is low.


An increase in the amount of work causing an increase in utilized threads, this could indicate that SQL Server is working under significant load or an excessive number of queries running in parallel.


Adjusting max worker threads is an advanced option and should be changed only by an experienced database administrator or certified SQL Server technician.

Thread pooling helps optimize performance when large numbers of clients are connected to the server. Usually, a separate operating system thread is created for each query request. However, with hundreds of connections to the server, using one thread per query request can consume large amounts of system resources. The max worker threads option enables SQL Server to create a pool of worker threads to service a larger number of query requests, which improves performance.

Configure the max worker threads Server Configuration Option:

Overridable Parameters



Default Value

Alert Priority

Defines Alert Priority.


Alert Severity

Defines Alert Severity.



Enables or disables the workflow.


Generates Alerts

Defines whether the workflow generates an Alert.


Interval (seconds)

The recurring interval of time in seconds in which to run the workflow.


Minimum Free Threads Threshold

The workflow determines the maximum number of threads and the number of active threads for each DB Engine process. An alert will be generated if the number of free threads is less or equal than this parameter.


Number of samples

Indicates how many times a measured value should breach a threshold before the state is changed.


Synchronization Time

The synchronization time specified by using a 24-hour format. May be omitted.


Timeout (seconds)

Specifies the time the workflow is allowed to run before being closed and marked as failed.


Timeout for database connection (seconds)

The workflow will fail and register an event, if it cannot access the database during the specified period.


Element properties:

Parent MonitorSystem.Health.PerformanceState
Alert GenerateTrue
Alert SeverityError
Alert PriorityNormal
Alert Auto ResolveTrue
Monitor TypeMicrosoft.SQLServer.Linux.MonitorType.DBEngine.ThreadCount
Alert Message
MSSQL on Linux: Thread Count is too high
SQL instance "{0}" Thread Count on computer "{1}" is too high. See "Alert Context" tab for more details.

Source Code:

<UnitMonitor ID="Microsoft.SQLServer.Linux.Monitor.DBEngine.ThreadCount" Accessibility="Public" Enabled="true" Target="SqlDiscL!Microsoft.SQLServer.Linux.DBEngine" ParentMonitorID="Health!System.Health.PerformanceState" Remotable="true" Priority="Normal" TypeID="Microsoft.SQLServer.Linux.MonitorType.DBEngine.ThreadCount" ConfirmDelivery="false">
<AlertSettings AlertMessage="Microsoft.SQLServer.Linux.Monitor.DBEngine.ThreadCount.AlertMessage">
<OperationalState ID="Normal" MonitorTypeStateID="Normal" HealthState="Success"/>
<OperationalState ID="Error" MonitorTypeStateID="Error" HealthState="Error"/>