'BIZTALK/DOC'에 해당되는 글 3건

  1. 2009.11.23 IIS 6.0 Tuning for Performance
  2. 2009.11.23 Tuning IIS - machine.config settings
  3. 2009.11.23 BizTalk 2004 Performance and Tuning
posted by 방랑군 2009. 11. 23. 19:32

"Some forms of reality are so horrible we refuse to face them, unless we are trapped into it by comedy. To label any subject unsuitable for comedy is to admit defeat." -- Peter Sellers (1925 - 1980)

In the Patterns and Practices Group's "Improving .NET Application Performance and Scalability", which is available in full text online and as a PDF download from the above link, as well as in softcover through MSPress and major booksellers, there are over 1000 pages and appendixes of detailed information about how to improve .NET application performance and scalability, written by the top experts in the business. One area that is both little understood and potentially confusing is the tuning of Internet Information Services 6.0.

The skinny about all this is that the PAP group says the default settings shipped with IIS and the .NET Framework should be changed. They provide detailed information in pages 332 through 342 in Chapter 6 on ASP.NET, and they provide even more information in Chapter 17. I'll summarize some of the more important points here, since I know that, human nature being what it is, most people running IIS and reading this article probably have not waded through this lengthy but excellent publication. Once you see the quality of the information you can get from it, it may encourage you to do so; it is an investment of your time as a professional ASP.NET developer that I highly recommend. The fact that the book is made available free online by Microsoft should not in any way diminish its importance or value to developers who are interested in achieving the absolute best performance and scalability from their .NET Applications.

NOTE:  This "helper" article focuses almost totally on the IIS-related issues and settings. However, Chapter 6 and additional information in the various checklists and in Chapter 17 address many other issues that are related to, but do not specifically involve IIS 6.0 settings. Some of these can be addressed at the machine.config level, others are "best practices" coding techniques, and some can be addressed in web.config. Paragraphs marked "Discussion" are my individual comments. The rest is (mostly) untouched snippets from the PAP publication itself.

First, lets examine some of the "reduce contention" formula settings. All this information, and a lot more, is right in the book:

Formula for Reducing Contention

The formula for reducing contention can give you a good empirical start for tuning the ASP.NET thread pool. Consider using the Microsoft product group-recommended settings that are shown in Table 6.1 if the following conditions are true:

  • You have available CPU.
  • Your application performs I/O bound operations such as calling a Web method or accessing the file system.
  • The ASP.NET Applications/Requests In Application Queue performance counter indicates that you have queued requests.

Table 6.1: Recommended Threading Settings for Reducing Contention

Configuration setting Default value (.NET Framework 1.1) Recommended value
maxconnection 2 12 * #CPUs
maxIoThreads 20 100
maxWorkerThreads 20 100
minFreeThreads 8 88 * #CPUs
minLocalRequestFreeThreads 4 76 * #CPUs

To address this issue, you need to configure the following items in the Machine.config file. Apply the recommended changes that are described in the following section, across the settings and not in isolation. For a detailed description of each of these settings, see "Thread Pool Attributes" in Chapter 17, "Tuning .NET Application Performance."

  • Set maxconnection to 12 * # of CPUs . This setting controls the maximum number of outgoing HTTP connections that you can initiate from a client. In this case, ASP.NET is the client. Set maxconnection to 12 * # of CPUs.
  • Set maxIoThreads to 100 . This setting controls the maximum number of I/O threads in the .NET thread pool. This number is automatically multiplied by the number of available CPUs. Set maxloThreads to 100.
  • Set maxWorkerThreads to 100 . This setting controls the maximum number of worker threads in the thread pool. This number is then automatically multiplied by the number of available CPUs. Set maxWorkerThreads to 100.
  • Set minFreeThreads to 88 * # of CPUs . This setting is used by the worker process to queue all the incoming requests if the number of available threads in the thread pool falls below the value for this setting. This setting effectively limits the number of requests that can run concurrently tomaxWorkerThreads � minFreeThreads . Set minFreeThreads to 88 * # of CPUs. This limits the number of concurrent requests to 12 (assumingmaxWorkerThreads is 100).
  • Set minLocalRequestFreeThreads to 76 * # of CPUs . This setting is used by the worker process to queue requests from localhost (where a Web application sends requests to a local Web service) if the number of available threads in the thread pool falls below this number. This setting is similar tominFreeThreads but it only applies to localhost requests from the local computer. Set minLocalRequestFreeThreads to 76 * # of CPUs.

Discussion: The proviso above indicates that these settings should be used when your application has I/O bound operations and the Applications/Requests In Application Queue perfcounter indicates you have queued requests. However, I have found that settings approaching those indicated can improve performance on ASP.NET apps that do not exhibit these conditions. I recommend using the "Homer" web stress tool from at least one remote machine (and preferably more than one machine, with the supplied ASP controller page), or the .NET ACT Application Center Test application, to throw a good solid load at your app and carefully measure the performance statistics with each set of both the default and the above settings. In particular, pay close attention to the Requests per second and the time to last byte readings. This baseline testing scenario should provide the basis for further tuning if it is necessary, and it doesn't take long at all. You can only improve something if you have metrics, and the way you get the metrics is to take the time to get them! You can easily script all kinds of "user paths" through your ASP.NET application with testing software such as is mentioned here, and get the important baseline metrics you need. One more thing-- rule number 1 of software testing and debugging:

"When you are going to change something, ONLY CHANGE ONE THING AT A TIME!" Test it, get the metrics, and only then, proceed.

Kernel Mode Caching

If you deploy your application on Windows Server 2003, ASP.NET pages automatically benefit from the IIS 6.0 kernel cache. The kernel cache is managed by the HTTP.sys kernel-mode device driver. This driver handles all HTTP requests. Kernel mode caching may produce significant performance gains because requests for cached responses are served without switching to user mode.

The following default setting in the Machine.config file ensures that dynamically generated ASP.NET pages can use kernel mode caching, subject to the requirements listed below.

<httpRunTime enableKernelOutputCache="true" . . ./>

Dynamically generated ASP.NET pages are automatically cached subject to the following restrictions:

  • Pages must be retrieved by using HTTP GET requests. Responses to HTTP POST requests are not cached in the kernel.
  • Query strings are ignored when responses are cached. If you want a request for http://contoso.com/myapp.aspx?id=1234 to be cached in the kernel, all requests for http://contoso.com/myapp.aspx are served from the cache, regardless of the query string.
  • Pages must have an expiration policy. In other words, the pages must have an Expires header.
  • Pages must not have VaryByParams .
  • Pages must not have VaryByHeaders .
  • The page must not have security restrictions. In other words, the request must be anonymous and not require authentication. The HTTP.sys driver only caches anonymous responses.
  • There must be no filters configured for the W3wp.exe file instance that are unaware of the kernel cache.

Discussion: The "enableKernelOutputCache = "true" setting IS NOT present in the default machine.config "httpRunTime" element. Since it is not present, we should be able to expect that the default setting of "true" is automatic. Personally, I feel better explicitly putting the attribute in there, and setting it to "true". As an aside, I have found that it is ALWAYS a good idea to KEEP A BACKUP COPY of your machine.config stored somewhere safe.

Tuning the Thread Pool for Burst Load Scenarios

If your application experiences unusually high loads of users in small bursts (for example, 1000 clients all logging in at 9 A.M. in the morning), your system may be unable to handle the burst load. Consider setting minWorkerThreads and minIOThreads as specified in Knowledge Base article 810259, "FIX: SetMinThreads and GetMinThreads API Added to Common Language Runtime ThreadPool Class," at http://support.microsoft.com/default.aspx?scid=kb;en-us;810259 .

Discussion: The .NET Threadpool is somewhat limited in its flexibility and is specifically limited in terms of how many instances you may have per process, since it is static. If you have ASP.NET applications that specifically need to run background thread processing, you may wish to investigate using a custom threadpool class. I have used Ami Bar's SmartThreadPool with great success, and have even modified it to provide a ThreadPriority overload. You can have more than one instance of this pool, and each can be custom configured. This type of approach provides maximum flexibility while simultaneously permitting individual threadpool tuning of critical resources.

Tuning the Thread Pool When Calling COM Objects

ASP.NET Web pages that call single-threaded apartment (STA) COM objects should use the ASPCOMPAT attribute. The use of this attribute ensures that the call is executed using a thread from the STA thread pool. However, all calls to an individual COM object must be executed on the same thread. As a result, the thread count for the process can increases during periods of high load. You can monitor the number of active threads used in the ASP.NET worker process by viewing theProcess:Thread Count (aspnet_wp instance) performance counter.

The thread count value is higher for an application when you are using ASPCOMPAT attribute compared to when you are not using it. When tuning the thread pool for scenarios where your application extensively uses STA COM components and the ASPCOMPAT attribute, you should ensure that the total thread count for the worker process does not exceed the following value.

75 + ((maxWorkerThread + maxIoThreads) * #CPUs * 2)

Evaluating the Change

To determine whether the formula for reducing contention has worked, look for improved throughput. Specifically, look for the following improvements:

  • CPU utilization increases.
  • Throughput increases according to the ASP.NET Applications\Requests/Sec performance counter.
  • Requests in the application queue decrease according to the ASP.NET Applications\Requests In Application Queue performance counter.

If this change does not improve your scenario, you may have a CPU-bound scenario. In a CPU-bound scenario, adding more threads may increase thread context switching, further degrading performance.

When tuning the thread pool, monitor the Process\Thread Count (aspnet_wp) performance counter. This value should not be more than the following.

75 + ((maxWorkerThread + maxIoThreads) * #CPUs)

If you are using AspCompat, then this value should not be more than the following.

75 + ((maxWorkerThread + maxIoThreads) * #CPUs * 2)

Values beyond this maximum tend to increase processor context switching.

Discussion: There is a long list of attention items that revolve around and are tightly woven into the IIS tuning issue for ASP.NET application tuning and scalability. These include, but are not limted to the following:

  • Improving page response times.
  • Designing scalable Web applications.
  • Using server controls efficiently.
  • Using efficient caching strategies.
  • Analyzing and applying appropriate state management techniques.
  • Minimizing view state impact.
  • Improving performance without impacting security.
  • Minimizing COM interop scalability issues.
  • Optimizing threading.
  • Optimizing resource management.
  • Avoiding common data binding mistakes.
  • Using security settings to reduce server load.
  • Avoiding common deployment mistakes.

You can find detailed treatment of most of these issues in Chapter 6 of the above-captioned publication.

I hope this brief synopsis of IIS tuning parameters is useful to you. Once again, I strongly recommend reading all this in the bigger context of the book, and mapping out an optimization plan that includes code review, refactoring, and optimization tuning both at the ASP.NET application and IIS webserver levels. One of the great things about the lessons learned from IIS / ASP.NET testing and tuning optimizations is that they can be carried forward to new applications and will improve your skills and value as a professional developer. I spent nearly three weeks at the Microsoft Testing Lab in Charlotte, NC under the tutelage of Dennis Bass and his fine crew, and the lessons learned there were invaluable. If this book were avalable then, I may not have needed to spend so many nights in hotel rooms.

 

'BIZTALK > DOC' 카테고리의 다른 글

Tuning IIS - machine.config settings  (0) 2009.11.23
BizTalk 2004 Performance and Tuning  (0) 2009.11.23
posted by 방랑군 2009. 11. 23. 19:31
Tuning IIS - machine.config settings

Recently I needed to try and reduce contention within IIS when calling a number of web services.  Eventually this led to the need to make some changes to the machine.config file.

The changes identified were based on the Microsoft recommended settings.  These recommended values should be viewed as a start point for continued tuning, but have been shown to work in most circumstances.  They are based on the premise that for each ASPX page in use you are making one Web service call to a single IP address.

It is only suggested that you try this in situations where you are performing operations such as calling Web Services or accessing files (IO processes) and you have some available processing power.

It is not recommended that these changes be applied in isolation, as this causes problems.  Similarly, setting these values incorrectly can also cause problems.  

Some of these recommendations involve a simple formula that involves the number of CPUs on a server.  Where hyperthreading is enabled, you should base the calculation on the number of logical CPUs and not the number of physical CPUs.

i.e. On a two-processor server with hyperthreading enabled, you should be calculating these settings based on 4 CPUs not 2.

The recommendations I followed are detailed below, followed by an example of these setting in the machine.config file.  I have also included a couple of links that hepled me identify the changes I needed; these may be of interest if you want to read into this further.

The machine.config file can be found in the \WINDOWS\Microsoft.NET\Framework\vXXXX\CONFIG directory.

 

maxconnection

Controls the maximum number of outgoing HTTP connections that you can initiate from a client to a specific IP address.

Setting the address attribute to * applies this value to all addresses.  You can include multiple entries for this setting to control the maximum number of connections to specific IP addresses.

The maxconnection parameter setting applies at the AppDomain level. By default, you can create a maximum of two connections to a specific IP address from each AppDomain in your process.

This setting is not automatically multiplied by the number of available CPUs, you must do this yourself.

Default                              2
Recommended              12 * Number of CPUs 

maxIoThreads

Controls the maximum number of I/O threads in the .NET thread pool. 

This number is automatically multiplied by the number of available CPUs.

Default                              20
Recommended              100 
 


maxWorkerThreads                 

Controls the maximum number of worker threads in the thread pool.


This number is then automatically multiplied by the number of available CPUs.

Default                              20
Recommended              100 
 

minWorkerThreads

Determines how many worker threads may be made available immediately to service a remote request.  This can be useful when there may be sudden rise in the number of requests, such as a burst of requests from another server or from client users.  This enable ASP.NET to service requests that may be suddenly filling the ASP.NET request queue. 


This number is then automatically multiplied by the number of available CPUs.


Default                              1
Recommended              maxWorkerThreads / 2
 

minIoThreads

Determines how many of I/O threads may be made available immediately in the .NET thread pool.

This number is then automatically multiplied by the number of available CPUs.

Default                              1
Recommended              maxIoThreads / 2


minFreeThreads

Used by the worker process to queue all the incoming requests.  This only applies if the number of available threads in the thread pool falls below the value for this setting.

This setting is not automatically multiplied by the number of available CPUs, you must do this yourself.

This setting effectively limits the number of requests that can run concurrently to maxWorkerThreads - minFreeThreads .

Default                              8                                  
Recommended              88 * Number of CPUs

Following the recommendation above limits the number of concurrent requests to 12 per CPU (assuming maxWorkerThreads is 100) because 100 - 88 = 12.  This leaves at least 88 worker threads per CPU and 88 completion port threads per CPU available for other uses (such as for the Web service callbacks).


minLocalRequestFreeThreads            

Used by the worker process to queue requests from localhost, such as requests to a local Web service.  This only applies if the number of available threads in the thread pool falls below this number.

This setting is not automatically multiplied by the number of available CPUs, you must do this yourself.

This setting is similar to minFreeThreads but it only applies to localhost requests from the local computer.

Default                              4
Recommended              76 * Number of CPUs  
 

Example

An example of how these entries might look in the machine.config file is shown below.  This is an edited version of this file, focusing only on those settings discussed above.

 <configuration>
 <system.net>
         <connectionManagement>
             <add address="*" maxconnection="24" />
         </connectionManagement>
     </system.net>
     <system.web>
         <processModel autoConfig="true"
             maxWorkerThreads = "100"
             maxIoThreads = "100"
             minWorkerThreads = "50"
             minIoThreads = "50"
         />
         <httpRuntime 
             minFreeThreads="176" 
             minLocalRequestFreeThreads="152" 
         />
     </system.web>
</configuration>

Links

Contention, poor performance, and deadlocks when you make Web service requests from ASP.NET applications

IIS 6.0 Tuning for Performance

'BIZTALK > DOC' 카테고리의 다른 글

IIS 6.0 Tuning for Performance  (0) 2009.11.23
BizTalk 2004 Performance and Tuning  (0) 2009.11.23
posted by 방랑군 2009. 11. 23. 19:01




BizTalk 2004 Performance and Tuning

Recently I had cause to investigate performance and tuning of BizTalk Server 2004, and found that although there was some useful and interesting information available, there was usually little actual guidance on how to apply even the simplest settings to your specific solution/environment. 

When you take a look at the guidance available for tuning IIS, there are some reasonably simple steps that you can follow to get you started; for example you can make some simple changes to machine.config based on some simple calculations and the number of CPUs in use.  I previsouly  discussed this inTuning IIS - machine.config Settings

For BizTalk Server 2004, once you look beyond the hardware options (such as scaling up the CPU(s) in use or scaling out the number of BizTalk Servers in use) I was unable to find much that was as simple to follow as these IIS guidelines. 

Although I have still not yet found the magic formula, the potential for tweaking your BizTalk Server 2004 installation is there, so here are some thoughts and settings that you may find useful when looking into this yourself. 

Create Separate Hosts

It is highly recommended that you create separate hosts to handle different jobs and processes within your BizTalk Server 2004 solution.

I would suggest that a good starting point is to consider separating out the following:

  • Orchestrations
  • Adapters
  • BizTalk Host Tracking

Separating the Orchestrations from the Adapters will also help reduce resource contention when dealing with higher load, as you will have separate host processes dealing with the send/receive (adapters) and the business process (orchetsrations) for each process being handled.

You may also wish to investigate further separtion of these hosts, creating separate hosts for related Orchestrations and Adapter types.  My preferred option is to provide Orchestration hosts for each of my "applications" and then a separate host for each Adapter type.

As each host runs in its own process, this gives you a more robust and flexibible solution; individual hosts can be stopped and started and a failure in one host will not automatically bring down all processes. 

BizTalk Server Engine

The performance characteristics of the BizTalk Server engine can be modified by changing the following columns in the adm_ServiceClass table of the BizTalkMgmtDb database:

HighWatermark / LowWatermark

These settings determine the outbound processing rate for messages, representing the high and medium stress-level thresholds. They define the number of messages processed by BizTalk Server 2004, but not yet consumed by subscribers.

When BizTalk Server processes more messages than specified by the HighWatermark, it will stop processing messages from the message box until the number of active messages drops below the LowWatermark threshold.

HighMemorymark / LowMemorymark

These settings control the memory thresholds at which BizTalk Server 2004 starts and stops processing messages. They define the percentage of overall memory consumed and affect both inbound and outbound throughput.

When BizTalk Server memory consumption reaches the level defined by the LowMemorymark, BizTalk Server increases the stress level, and by extension the CPU usage on the host server.

If memory consumption reaches the level defined by the HighMemorymark, BizTalk Server stops processing messages until memory consumption is reduced.

BizTalk Server also stops creating new orchestrations when the memory consumption reaches the HighMemorymark.  Orchestration creation is only resumed once the memory consumption reaches the LowMemorymark.

HighSessionmark / LowSessionmark

These settings determine the inbound processing rate for messages and represent high and medium stress-level thresholds.

They define the number of parallel database sessions that are persisting messages to the message box.  When the number of sessions specified by the HighSessionmark is exceeded, BizTalk Server blocks incoming messages until the number of sessions decreases below the LowSessionmark
 
Threading Issues

With thread starvation, you may see slow performance when using the SOAP, HTTP, or WSE adapters, including situations where a large flood of messages can trigger a degradation of performance.

The BizTalk host(s) with the SOAP, HTTP or WSE Adapters running has worker threads handling queued work items and I/O threads for completed asynchronous I/O requests. Problems can occur when there are not enough free threads in the thread pools to handle the number of messages (SOAP, HTTP, or WSE requests). 

A freshly started BizTalk host has default thread pool sizes that are small and therfore may not be able to handle requests made of it.  The adapter must then add more worker or I/O threads to the thread pool, stopping once there are enough to fulfill the request or the maximum thread limit is reached. This can be time consuming. 

If the maximum thread pool limit is not large enough to handle the sustained work load, messages must wait until a thread becomes available before they can be processed.

Minimum worker and I/O thread pool sizes should be set at a level appropriate to the initial and sustained work load.

MinIOThreads

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\BTSSvc.3.0{guid}]\CLR Hosting

This DWORD is the minimum number of threads, per processor, available from the CLR thread pool at any given time.

This number is automatically multiplied by the number of available CPUs and should have the same values as MinWorkerThreads.  If MinWorkerThreads is configured but MinIOThreads is not, BizTalk server sets this to the value of MaxWorkerThreads.

Default                     1
Recommended     Maximum number of messages received at initialization + 10 percent

MinWorkerThreads

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\ Services\BTSSvc.3.0{guid}]\CLR Hosting

This DWORD is the minimum number of threads, per processor, available from the CLR thread pool at any given time.

This number is automatically multiplied by the number of available CPUs. 

Default                     1
Recommended     Maximum number of messages received at initialization + 10 percent

The maximum worker and I/O thread pool sizes should be set to cater for sustained and peak burst loads. These loads should be defined by the business requirements and validated during stress testing. It is not recommended to define excessive thread pool sizes, as although this may resolve thread starvation it can increase context switching and this can offset the performance gained

MaxIOThreads

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\BTSSvc.3.0{guid}

This DWORD is the number of threads per processor that will run to handle I/O within the common language runtime or Microsoft .NET connection software.

This number is automatically multiplied by the number of available CPUs and should have the same values as MaxWorkerThreads.  If MaxWorkerThreads is configured but MaxIOThreads is not, BizTalk server sets this to the value of MaxWorkerThreads.

Default: 20

MaxWorkerThreads

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\BTSSvc.3.0{guid}

This DWORD is the number of threads per processor that the HTTP adapter will use to process messages.

This number is automatically multiplied by the number of available CPUs.

Default: 25

A larger thread pool can put more pressure on your Biztalk Server CPUs and the SQL Server hosting the BizTalk databases. Increasing the MaxWorkerThreads value beyond 100 can have an adverse effect on the performance of SQL Server. Make sure the computer(s) installed with SQL Server can handle the additional stress before increasing the thread pool size greater than 100.

MessagingThreadPoolSize

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\BTSSvc.3.0{guid}

This defines the number of threads that will be used to process messages on a per processor basis on the computer running BizTalk Server.

MessagingThreadsPerCpu

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\BTSSvc.3.0                              (Isolated Host)

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\BTSSvc{guid of the host}      (In-process hosts)

This DWORD defines the number of threads per CPU processor that BizTalk Server uses to process incoming message batches for the isolated host or in-process host that you define it against.  Larger numbers increase the CPU processor utilization in the receive host. Smaller numbers might improve performance if there is excessive context switching in the receive host.

ASP .NET Settings Related to HTTP, SOAP, or WSE Adapter Performance

In addition to thread starvation, there are several ASP.NET settings affecting SOAP, HTTP, or WSE adapter performance. These settings are made in the web.config or machine.config files. Because these adapters communicate with external Web sites or Web services, consider tuning these external components as part of overall performance review. The settings described in this section were sugegsted to be specific to BizTalk Server, but are similar to changes that can be made when tuning IIS.

The tunable attributes include maxconnection, maxWorkerThreads, minWorkerThreads, maxIOThreads, and minIOThreads. The properties that can be tuned include minFreeThreads and minLocalRequestFreeThreads.

maxconnection

Controls the maximum number of outgoing HTTP connections that you can initiate from a client to a specific IP address. This can be a bottleneck if BizTalk Server makes a large number of HTTP, SOAP, or WSE requests.

Setting the address attribute to * applies this value to all addresses.  You can include multiple entries for this setting to control the maximum number of connections to specific IP addresses.

The maxconnection parameter setting applies at the AppDomain level. By default, you can create a maximum of two connections to a specific IP address from each AppDomain in your process.

Increasing maxconnection attribute increases thread pool and CPU utilization. This may mean that the thread pool settings described in the previous section may not be optimal. Test larger thread pool sizes to determine if adjustment is necessary.

This setting is not automatically multiplied by the number of available CPUs, you must do this yourself.

Default                     2
Recommended     12 * Number of CPUs 

maxIoThreads

Controls the maximum number of I/O threads in the .NET thread pool. 

This number is automatically multiplied by the number of available CPUs.

Default                     20
Recommended     100 

maxWorkerThreads                 

Controls the maximum number of worker threads in the thread pool.

This number is then automatically multiplied by the number of available CPUs.

Default                     20
Recommended     100 

minWorkerThreads

Determines how many worker threads may be made available immediately to service a remote request.  This can be useful when there may be sudden rise in the number of requests, such as a burst of requests from another server or from client users.  This enables ASP.NET to service requests that may be suddenly filling the ASP.NET request queue.

This number is then automatically multiplied by the number of available CPUs.

Default                     1
Recommended     maxWorkerThreads / 2 

minIoThreads

Determines how many of I/O threads may be made available immediately in the .NET thread pool.

This number is then automatically multiplied by the number of available CPUs.

Default                     1
Recommended     maxIoThreads / 2

minFreeThreads

Used by the worker process to queue all the incoming requests.  This only applies if the number of available threads in the thread pool falls below the value for this setting.

This setting is not automatically multiplied by the number of available CPUs, you must do this yourself.

This setting effectively limits the number of requests that can run concurrently to maxWorkerThreads - minFreeThreads .

Default                     8                                  
Recommended     88 * Number of CPUs

Following the recommendation above limits the number of concurrent requests to 12 per CPU (assuming maxWorkerThreads is 100) because 100 - 88 = 12.  This leaves at least 88 worker threads per CPU and 88 completion port threads per CPU available for other uses (such as for the Web service callbacks).

minLocalRequestFreeThreads            

Used by the worker process to queue requests from localhost, such as requests to a local Web service.  This only applies if the number of available threads in the thread pool falls below this number.

This setting is not automatically multiplied by the number of available CPUs, you must do this yourself.

This setting is similar to minFreeThreads but it only applies to localhost requests from the local computer.

Default                     4
Recommended     76 * Number

Messaging Changes

HTTPBatchSize

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\BTSSvc.3.0\ HTTPReceive

This setting specifies the batch size that the HTTP receive adapter uses to submit requests to BizTalk Server.  By default the HTTP Receive adapter waits for a batch of ten messages to accumulate in order to submit them all at once, or until a one-second time-out has elapsed.

You can decrease the latency of HTTP request/response processes by creating and setting this DWORD registry key to 1.  This forces the HTTP receive adapter to submit each message as soon as it is received.

Links

The following MSDN links both have some great information (and lots of it) but you are still left to your own devices when applying these to your specific scenario:

BizTalk Server 2004: Performance Tuning for Low Latency Messaging

BizTalk Server 2004 Performance Characteristics

I also found a decent overview of a particular implementation of some of these settings, although it is not fully clear what the scenario that is being implemented is or how the setting used were decided upon:

BizTalk 2004 Tuning Recommendations

For BizTalk 2006 I found a decent overview of what can be done to help when using the Soap adapter, and much of this is also applicable to BizTalk Server 2004:

'BIZTALK > DOC' 카테고리의 다른 글

IIS 6.0 Tuning for Performance  (0) 2009.11.23
Tuning IIS - machine.config settings  (0) 2009.11.23