[Progress Communities] [Progress OpenEdge ABL] Forum Post: RE: PASOE only running two HTTP session requests concurrently

  • Thread starter Thread starter dbeavon
  • Start date Start date
Status
Not open for further replies.
D

dbeavon

Guest
I finally figured out why a .Net open client would only allow two appserver requests to be sent to PASOE at a time. By breaking the debugger, I noticed that most of my waiting callstacks looked like this. mscorlib.dll!System.Threading.WaitHandle.InternalWaitOne(System.Runtime.InteropServices.SafeHandle waitableSafeHandle, long millisecondsTimeout, bool hasThreadAffinity, bool exitContext) mscorlib.dll!System.Threading.WaitHandle.WaitOne(int millisecondsTimeout, bool exitContext) System.dll!System.Net.LazyAsyncResult.WaitForCompletion(bool snap) System.dll!System.Net.Connection.SubmitRequest(System.Net.HttpWebRequest request, bool forcedsubmit) System.dll!System.Net.ServicePoint.SubmitRequest(System.Net.HttpWebRequest request, string connName) System.dll!System.Net.HttpWebRequest.SubmitRequest(System.Net.ServicePoint servicePoint) System.dll!System.Net.HttpWebRequest.GetRequestStream(out System.Net.TransportContext context) System.dll!System.Net.HttpWebRequest.GetRequestStream() Progress.o4glrt.dll!Progress.UBroker.Util.HTTPConnection.Post(byte[] data, Progress.Common.Util.NVPair[] headers, Progress.UBroker.Util.UBWebRequest webRequest) After a bit of googling, I discovered that there is a "service point manager" which deliberately throttles the client to only send out a couple of requests at a time (to the same endpoint). The related class that serves this purpose is System.Net.ServicePointManager. Max number of concurrent HttpWebRequests ServicePointManager.DefaultConnectionLimit Property (System.Net) There is a fix to change the throttling. Here is some code that can change it.... /// /// Static values used for HTTP clients. /// public static void SetStaticServicePointManagerProperties( int p_DefaultConnectionLimit = 100, bool p_UseNagleAlgorithm = false, bool p_UnlimitedServicePoints = true, int p_MaxServicePoints = 1000) { // Default limit should be at least 10 System.Net.ServicePointManager.DefaultConnectionLimit = p_DefaultConnectionLimit; // Whether to use nagle (delayed packet transmission) System.Net.ServicePointManager.UseNagleAlgorithm = p_UseNagleAlgorithm; // Optional limit on service points if (p_UnlimitedServicePoints) { // 0 means there is no limit to the number of System.Net.ServicePoint objects. System.Net.ServicePointManager.MaxServicePoints = 0; } else { // Specify the maximum System.Net.ServicePointManager.MaxServicePoints = p_MaxServicePoints; } } Hope this helps anyone who may encounter the same problem. At this point I am doubtful that the Progress open client API directly exposes the ServicePointManager's "DefaultConnectionLimit". (especially since that API was retrofitted quite a bit after PASOE came along). Keep in mind that the change affects all HTTP requests from the same .Net app, not just PASOE.

Continue reading...
 
Status
Not open for further replies.
Back
Top