
CLR Hosting thread values for the host
Because a Windows thread is the most basic executable unit available to a Windows process it is important to allocate enough threads to the .NET thread pool associated with an instance of a BizTalk host to prevent thread starvation. When thread starvation occurs there are not enough threads available to perform the requested work which negatively impacts performance. At the same time, care should be taken to prevent allocating more threads to the.NET thread pool associated with a host than is necessary. The allocation of too many threads to the.NET thread pool associated with a host may increase context switching. Context switching occurs when the Windows kernel switches from running one thread to a different thread which incurs a performance cost. Excessive thread allocation can cause excessive context switching which will negatively impact overall performance.
Modify the number of Windows threads available in the .NET thread pool associated with an instance of a BizTalk host by creating the appropriate CLR Hosting values in the registry of the BizTalk Server.
Warning |
|---|
|
Incorrect use of Registry Editor may cause problems requiring you to reinstall your operating system. Use Registry Editor at your own risk. For more information about how to back up, restore, and modify the registry, see the Microsoft Knowledge Base article "Description of the Microsoft Windows registry" at http://go.microsoft.com/fwlink/?LinkId=62729. |
Note |
|---|
| Worker threads are used to handle queued work items and I/O threads are dedicated callback threads associated with an I/O completion port to handle a completed asynchronous I/O request. |
To modify the number of threads available in the.NET thread pool associated with each instance of a BizTalk host, follow these steps:
-
Stop the BizTalk host.
-
Click Start, click Run, type regedit.exe, and then click OK to start Registry Editor.
Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\BTSSvc$hostname] where hostname is the name of the host associated with the host instance.
Note |
|---|
|
This registry key may be represented as HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\BTSSvcguid] where guid is a GUID unique to each instance of a BizTalk Server host if you have upgraded your BizTalk Server 2006 installation from BizTalk Server 2004. |
-
Under the CLR Hosting key, create the following DWORD entries with the indicated values.
|
DWORD entry
|
Default value
|
Recommended value
|
| MaxIOThreads | 20 | 100 |
| MaxWorkerThreads | 25 | 100 Important |
|---|
|
Increasing this value beyond 100 can have an adverse effect on the performance of the SQL Server computer that is hosting the BizTalk Server MessageBox database. When this problem occurs, SQL Server may encounter a deadlock condition. It is recommended that this parameter is not increased beyond a value of 100. |
|
| MinIOThreads | 1 | 25 |
| MinWorkerThreads | 1 | 25 |
Note |
|---|
|
These recommended values will be sufficient for most scenarios but may need to be increased depending on how many adapter handlers or orchestrations are running in each instance of the host. |
Note |
|---|
|
These values are implicilty multiplied by the number of processors on the server. For example, setting the MaxWorkerThreads entry to a value of 100 would effectively set a value of 400 on a 4 CPU server. |
-
Close Registry Editor.
-
Restart the BizTalk host.