azureroleworker

ServicePointManager.DefaultConnectionLimit in Worker Role


Just learning about Windows Azure at the moment.

I'm looking at a few samples and in the OnStart Event of a worker role I see

ServicePointManager.DefaultConnectionLimit = 5;

I do not understand the relevance of this.

In your worker role, you can set the number of instances so surely this limits the number of entries?

Sorry I'm confused.


Solution

  • We hit a problem similar to this on our team. By default, the default number of outgoing connections per domain is set to 2 by default. This limits the number of concurrent connections that you can have and can cause perform issues. I'd take a look at the blog below, which goes into some detail on the problem.

    https://learn.microsoft.com/en-us/archive/blogs/jpsanders/understanding-maxservicepointidletime-and-defaultconnectionlimit

    In terms of adjusting the number of instances, while can scale out the number of instances that are running inside of Azure, simply scaling out will not address bottlenecks on a single instance.