HTTP Keep-Alive’s and BizTalk

A client recently requested that we disable Keep-Alive’s in the HTTP request messages that we were sending. It’s a bit beyond the scope of this post but in certain circumstances using Keep-Alive’s results in server affinity and thereby impede scalability in a load balanced environment. This post is more about seeing it in action and disabling it.

 

We were using a WCF Adapter on the send port in BizTalk and the option to disable keep-alive’s isn’t available on any of the HTTP based bindings. One needs to create a custom binding in order to get to the keepAliveEnabled property on the httpTransport (or httpsTransport in this case) binding element. Here is a screenshot of an example of the configuration:

 

CGM 3 1 Custombinding 

 

After setting up the port, enabling some network tracing and doing some testing we could indeed see the difference the new configuration made to the headers in the HTTP request messages:

 

HTTP Request headers before:

 

 CGM 3 2 Sendingheaders Before

HTTP Request headers after:

 

 CGM 3 3 Sendingheaders After

 

To configure network tracing you could use these instructions.

 

I wasn’t completely satisfied with just seeing the headers changed and also wanted to see this in action (also, we were doing some volume and performance testing at the time and I also wanted to see the maxconnections changes in action too) so I was looking for a quick and simple way to get some visibility of all of this.

 

After some digging around online I rediscovered TCPView from the Windows Sysinternals suite which did the job perfectly. Testing each of the configurations above (Keep-Alive’s enabled and disabled) and generating some load on the system, I was able to easily see exactly how many connections BizTalk had established to the remote web server at any given time (which matched my maxconnections changes) and also I was able to see how the connections were persisted when Keep-Alive’s were enabled and how they got dropped and re-established when Keep-Alive’s were disabled. This gave me more visible results of the changes that I was making which is, as the acronym goes, SMART!

 

CGM 3 4 Tcpview 

 

This screenshot above shows the connections dropped (in red) and new connections (in green) between each refresh. The above screenshot shows the behaviour when Keep Alive’s are disabled. When they are enabled the connections just stay there (in white) until all the processing on BizTalk has completed.

 

I would be interested to know if you know of easier or better ways to see the TCP connections in action, please get in touch.

Written by Carlo Garcia-Mier at 00:00

Categories :

0 Comments :

Comment

Comments closed