Quantcast
Channel: Common Language Runtime Internals and Architecture forum
Viewing all articles
Browse latest Browse all 1710

System.Net.HttpWebRequest Connection Pool Behavior

$
0
0

Hello experts,

Have questions about the behavior of the HTTP connection pool (ServicePoint) that backs the System.Net.HTTPWebRequest class.


Quick "diagram" and background for discussion: Application Server -> Load Balancer -> OData WebAPI Data Services.  Application Servers are using HTTPWebRequest class to make calls to the OData WebAPI. To satisfy a requirement of end-to-end SSL between our Applicaiton Server in our N-tier environment, we have elected to place load balancers in a layer 4 (TCP socket) mode to avoid additional decrypted/encrypt overhead.  

We are aware of the following properties we can use to control some behavior and will be changing defaults to ensure sufficent connections are created and also to ensure they reconnection on occassion and not stay pinned to a given host forever.

ServicePoint.ConnectionLimit 
ServicePoint.MaxIdleTime 
ServicePoint.ConnectionLeaseTimeout


There are two main concerns regarding the ServicePoint behavior we are looking to understand
1) Will the connections for a given ServicePoint be used in a balanced way (i.e. if ServicePoint creates 5 connections will all 5 be used or will the same be used 
2) What triggers .NET to add another physical connection to a ServicePoint?  Is there a way we can preinit the ServicePoint up to the ConnectionLimit (i.e. achieve a "min pool size?).


The questions are to understand how to achieve an evan balance of transactions served on each active connection.


Thanks in advance!


Viewing all articles
Browse latest Browse all 1710

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>