Biztalk Server 2004 SOAP Adapter Issue

October 27th, 2006 by pdamiani

I have a Biztalk Server 2004 orchestration which interacts with a Web Service using the SOAP adapter. Under stress situations, such as lots of concurrent running orchestrations calling the Web Service, the SOAP adapter reports exceptions of type “not enough threads in the thread pool” as shown below:

The adapter failed to transmit message going to send port “http://myVirtualDirectory/ws.asmx”. It will be retransmitted after the retry interval specified for this Send Port. Details: “There were not enough free threads in the ThreadPool object to complete the operation.”

After doing some research, I've found not only an explanation but also a workaround:

Explanation

The error “not enough threads in the thread pool…” is due to a design flaw in CLR which was claimed to have been fixed in Whidbey. The reason for checking available threads before a request is pushed out is that the callback would take on another thread. So it tries to be smart. There is no guarantee a thread is available after the soap adapter checks for availability…

Workaround

In order to deal with this error, I had to make some performance tuning to the BizTalk Server engine, modifying some parameters of adm_ServiceClass table of the Biztalk Management database (BiztalkMgmtDB).

The parameters to be modified are the HighWatermark and LowWatermark: “These two settings determine the outbound processing rate for messages. They represent high and medium stress-level thresholds, respectively. Both settings define the number of messages processed by BizTalk Server 2004, but not yet consumed by subscribers. When BizTalk Server processes more messages (not yet consumed) than specified by the HighWatermark threshold, it stops processing messages from the message box until the number of active messages decreases below the LowWatermark threshold

I set these values to:

  • LowWatermark: 10
  • HighWatermark: 25 

There is a tool that allows you to change these settings easier. Download it from here!

Also I had to increase the maxWorkerThreads value (maximum number of worker threads per CPU) in the machine.config to 100:

  • maxWorkerThreads: 100  

With these configuration changes the issue was gone and everything seems to work fine!

You could find more information about BizTalk Server 2004 Performance Characteristics here: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/bts_2004wp/html/04d20926-20d2-4098-b701-52238a267eba.asp

Posted in Biztalk Server 2004 & 2006 | No Comments »


RSS Subscribe to my feed

Recent Posts

Map

Categories

Archives

Tags

Recent Comments