Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Commit 5175bf3

Browse files
authored
Merge pull request #14533 from pmasl/patch-786
Update configure-the-max-worker-threads-server-configuration-option.md
2 parents 17650e5 + 6b4a73e commit 5175bf3

1 file changed

Lines changed: 31 additions & 23 deletions

File tree

docs/database-engine/configure-windows/configure-the-max-worker-threads-server-configuration-option.md

Lines changed: 31 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Configure the max worker threads Server Configuration Option | Microsoft Docs"
33
ms.custom: ""
4-
ms.date: "11/23/2017"
4+
ms.date: "04/14/2020"
55
ms.prod: sql
66
ms.prod_service: high-availability
77
ms.reviewer: ""
@@ -41,43 +41,51 @@ ms.author: mikeray
4141

4242
### <a name="Restrictions"></a> Limitations and Restrictions
4343

44-
- When the actual number of query requests is less than the amount set in **max worker threads**, one thread handles each query request. However, if the actual number of query request exceeds the amount set in **max worker threads**, [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] pools the worker threads so that the next available worker thread can handle the request.
44+
- When the actual number of query requests is less than the amount set in **max worker threads**, one thread handles each query request. However, if the actual number of query requests exceeds the amount set in **max worker threads**, [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] pools the worker threads so that the next available worker thread can handle the request.
4545

4646
### <a name="Recommendations"></a> Recommendations
4747

4848
- This option is an advanced option and should be changed only by an experienced database administrator or certified [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] professional. If you suspect that there is a performance problem, it is probably not the availability of worker threads. The cause is more likely something like I/O that is causing the worker threads to wait. It is best to find the root cause of a performance issue before you change the max worker threads setting.
4949

5050
- 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 [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] to create a pool of worker threads to service a larger number of query requests, which improves performance.
5151

52-
- The following table shows the automatically configured number of max worker threads for various combinations of CPUs and versions of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)].
53-
54-
|Number of CPUs|32-bit computer|64-bit computer|
55-
|------------|------------|------------|
56-
|\<= 4 processors|256|512|
57-
|8 processors|288|576|
58-
|16 processors|352|704|
59-
|32 processors|480|960|
60-
|64 processors|736|1472|
61-
|128 processors|4224|4480|
62-
|256 processors|8320|8576|
52+
- The following table shows the automatically configured number of max worker threads for various combinations of CPUs, computer architecture, and versions of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)], using the formula: ***Default Max Workers* + ((*logical CPUs* - 4) * *Workers per CPU*)**.
53+
54+
|Number of CPUs|32-bit computer (up to [!INCLUDE[ssSQL14](../../includes/sssql14-md.md)])|64-bit computer (up to [!INCLUDE[ssSQL15](../../includes/sssql15-md.md)] SP1)|64-bit computer (starting with [!INCLUDE[ssSQL15](../../includes/sssql15-md.md)] SP2 and [!INCLUDE[ssSQL17](../../includes/sssql17-md.md)])|
55+
|------------|------------|------------|------------|
56+
|\<= 4|256|512|512|
57+
|8|288|576|576|
58+
|16|352|704|704|
59+
|32|480|960|960|
60+
|64|736|1472|2432|
61+
|128|1248|2496|4480|
62+
|256|2272|4544|8576|
6363

64-
Using the following formula:
64+
Up to [!INCLUDE[ssSQL15](../../includes/sssql15-md.md)] SP1, the *Workers per CPU* only depend on the architecture (32-bit or 64-bit):
6565

66-
|Number of CPUs|32-bit computer|64-bit computer|
67-
|------------|------------|------------|
68-
|\<= 4 processors|256|512|
69-
|\> 4 processors and \<= 64 processors|256 + ((logical CPU's - 4) * 8)|512 + ((logical CPU's - 4) * 16)|
70-
|\> 64 processors|256 + ((logical CPU's - 4) * 32)|512 + ((logical CPU's - 4) * 32)|
66+
|Number of CPUs|32-bit computer <sup>1</sup>|64-bit computer|
67+
|------------|------------|------------|
68+
|\<= 4|256|512|
69+
|\> 4|256 + ((logical CPU's - 4) * 8)|512 <sup>2</sup> + ((logical CPU's - 4) * 16)|
70+
71+
Starting with [!INCLUDE[ssSQL15](../../includes/sssql15-md.md)] SP2 and [!INCLUDE[ssSQL17](../../includes/sssql17-md.md)], the *Workers per CPU* depend on the architecture and number of processors (between 4 and 64, or greater than 64):
72+
73+
|Number of CPUs|32-bit computer <sup>1</sup>|64-bit computer|
74+
|------------|------------|------------|
75+
|\<= 4|256|512|
76+
|\> 4 and \<= 64|256 + ((logical CPU's - 4) * 8)|512 <sup>2</sup> + ((logical CPU's - 4) * 16)|
77+
|\> 64|256 + ((logical CPU's - 4) * 32)|512 <sup>2</sup> + ((logical CPU's - 4) * 32)|
7178

72-
> [!NOTE]
73-
> [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] can no longer be installed on a 32-bit operating system. 32-bit computer values are listed for the assistance of customers running [!INCLUDE[ssSQL14](../../includes/sssql14-md.md)] and earlier. We recommend 1,024 as the maximum number of worker threads for an instance of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] that is running on a 32-bit computer.
79+
<sup>1</sup> Starting with [!INCLUDE[ssSQL15](../../includes/sssql15-md.md)], [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] can no longer be installed on a 32-bit operating system. 32-bit computer values are listed for the assistance of customers running [!INCLUDE[ssSQL14](../../includes/sssql14-md.md)] and earlier. We recommend 1,024 as the maximum number of worker threads for an instance of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] that is running on a 32-bit computer.
80+
81+
<sup>2</sup> Starting with [!INCLUDE[ssSQL17](../../includes/sssql17-md.md)], the *Default Max Workers* value is divided by 2 for machines with less than 2GB of memory.
7482

75-
> [!NOTE]
83+
> [!TIP]
7684
> For recommendations on using more than 64 CPUs, refer to [Best Practices for Running SQL Server on Computers That Have More Than 64 CPUs](../../relational-databases/thread-and-task-architecture-guide.md#best-practices-for-running-sql-server-on-computers-that-have-more-than-64-cpus).
7785
7886
- When all worker threads are active with long running queries, [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] might appear unresponsive until a worker thread completes and becomes available. Although this is not a defect, it can sometimes be undesirable. If a process appears to be unresponsive and no new queries can be processed, then connect to [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] using the dedicated administrator connection (DAC), and kill the process. To prevent this, increase the number of max worker threads.
7987

80-
The **max worker threads** server configuration option does not limit all threads that may be spanwed in the system. Threads required for tasks such as Availibility Groups, Service Broker, Lock Manager, or others are spawned outside this limit. If the number of threads configured is being exceeded, the following query will provide information about the system tasks that have spawned the additional threads.
88+
The **max worker threads** server configuration option does not limit all threads that may be spawned in the system. Threads required for tasks such as Availability Groups, Service Broker, Lock Manager, or others are spawned outside this limit. If the number of threads configured is being exceeded, the following query will provide information about the system tasks that have spawned the additional threads.
8189

8290
```sql
8391
SELECT s.session_id, r.command, r.status,

0 commit comments

Comments
 (0)