Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.net 4.5 iis HighDensityWebHosting

In the change log for .net 4.5 there is a mention of this new setting

<configuration>
  <!-- ... -->
  <runtime>
    <performanceScenario value="HighDensityWebHosting"  />
  <!-- ... -->  

But there really no good description about what actually is affected by this setting, and should we bother to change it after installing .net 4.5 on production. Can someone share any details about what exactly this setting changes?

like image 638
Sly Avatar asked Oct 02 '22 11:10

Sly


1 Answers

Tuning GC for high-density Web hosting: GC can impact a site’s memory consumption, but it can be tuned to enable better performance. You can tune or configure GC for better CPU performance (slow down frequency of collections) or lower memory consumption (that is, more frequent collections to free up memory sooner). To enable the GC tuning, you can select the HighDensityWebHosting setting in the aspnet.config...

  • Source

Once a site is running, its use of the garbage-collector (GC) heap can be a significant factor in its memory consumption. Like any garbage collector, the .NET Framework GC makes tradeoffs between CPU time (frequency and significance of collections) and memory consumption (extra space that is used for new, freed, or free-able objects).

For the .NET Framework 4.5, instead of multiple standalone settings, a workload-defined configuration setting is available that enables all of the previously recommended GC settings as well as new tuning that delivers additional performance for the per-site working set.

  • Source, emphasis mine

This setting impacts garbage collector behavior. Based on the second quote, it's a shortcut for best practice settings that have already been published as well as new tuning settings. Presumably those "new tuning settings" also impact GC behavior.

I poked around the .Net source code to see if I could find more information on the implementation, but I didn't find anything (there are many places where this setting could be consumed).

like image 177
Tim M. Avatar answered Oct 15 '22 03:10

Tim M.