Skip to content

Instantly share code, notes, and snippets.

@jsturtevant
Created April 2, 2020 16:02
Show Gist options
  • Save jsturtevant/6508ba970c2e78d209fba01aa940bba0 to your computer and use it in GitHub Desktop.
Save jsturtevant/6508ba970c2e78d209fba01aa940bba0 to your computer and use it in GitHub Desktop.
Tuning .NET Full Framework for perf

Default Connection limit

Default connection limit has a long history. The Default connection limit has been much higher since asp.net 4.0 in where it was updated to 12*number of threads. In 4.6.1 and higher it is auto configuration for you to MaxInt (https://referencesource.microsoft.com/#System.Web/HttpRuntime.cs,1200). Given the long history of the value changing from one framework to another (and if you on different platform you will get the default value of 2) it is recommended to manually set it so you have have control, even if you set it to MaxInt.

If you want to modify it to something that is different there are some articles here on what changes it affects: https://docs.microsoft.com/en-us/dotnet/framework/network-programming/managing-connections A good article for grasping the implications of modifing that value is: https://docs.microsoft.com/en-us/archive/blogs/jpsanders/understanding-maxservicepointidletime-and-defaultconnectionlimit

other settings

In addition, it is suggested to look at a few more settings (you will need to consider if they are appropriate for you use cases):

Although related to using the storage apis there is good info here on the affect of those other values: https://social.msdn.microsoft.com/Forums/en-US/d84ba34b-b0e0-4961-a167-bbe7618beb83/net-and-adonet-data-service-performance-tips-for-windows-azure-tables?forum=windowsazuredata

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment