Skip to content

Commit 844ae61

Browse files
authored
DATAS .net 10 configs (#48665)
1 parent 01c292a commit 844ae61

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed

docs/core/runtime-config/garbage-collector.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -824,3 +824,67 @@ For more information about the first 3 settings, see the [Middle ground between
824824
| **runtimeconfig.json** | `System.GC.DynamicAdaptationMode` | `1` - enabled<br/> `0` - disabled | .NET 8 |
825825

826826
[!INCLUDE [runtimehostconfigurationoption](includes/runtimehostconfigurationoption.md)]
827+
828+
#### Target TCP
829+
830+
DATAS uses the Throughput Cost Percentage (TCP) as the memory cost measurement on throughput. It takes into consideration both GC pauses and how much allocations have to wait. Usually, GC pauses dominates, so you can use the "% pause time in GC" to approximate this cost. There are two transient cases where the allocation wait time can dominate:
831+
832+
- When a process starts, DATAS always starts with one heap. So if there are enough threads allocating, they experience waits.
833+
- When the workload changes from lighter to heavier, for example, when peak hours start, allocating threads might experience waits during that period of time. That's because it takes a few GCs before the number of heaps gets increased.
834+
835+
DATAS uses 2% as the default TCP, which you can adjust with this setting. It's an integer that is interpreted as a percentage, for example, 5 means the target TCP will be 5%.
836+
837+
| | Setting name | Values | Version introduced |
838+
|--------------------------|----------------------------|-----------|--------------------|
839+
| **runtimeconfig.json** | `System.GC.DTargetTCP` | *decimal value* | .NET 9 |
840+
| **Environment variable** | `DOTNET_GCDTargetTCP` | *hexadecimal value* | .NET 9 |
841+
842+
[!INCLUDE [runtimehostconfigurationoption](includes/runtimehostconfigurationoption.md)]
843+
844+
#### Gen0 max budget settings
845+
846+
Adjusting the gen0 budget is one of the key elements DATAS uses to adapt to application sizes. DATAS defines an upper threshold called the BCD (Budget Computed via DATAS) for the total gen0 budget as a function of the application size. The formula to calculate a multiplier is as follows:
847+
848+
$$
849+
f(\text{application\_size\_in\_MB}) = \frac{20 - \text{conserve\_memory}}{\sqrt{\text{application\_size\_in\_MB}}}
850+
$$
851+
852+
The formula is then clamped by a maximum and minimum value before it's applied to the application size in MB. If the [conserve memory](#conserve-memory) setting isn't specified, DATAS uses 5 by default. The maximum and minimum value default to 10 and 0.1, respectively.
853+
854+
For example, if the application size is 1 GB, the formula calculates `(20 - 5) / sqrt (1000) = 0.474`. Since it's between 10 and 0.1, clamping has no effect. This means the total gen0 budget is 47.4% of 1 GB which is 474 MB. If the application size is 1 MB, the formula would calculate 15 which would then be adjusted to 10, meaning the total gen0 budget allowed is 10 MB.
855+
856+
Three settings are provided to adjust what the formula calculates and modify the clamping values:
857+
858+
- The percent that will be applied to what `f` calculates.
859+
860+
| | Setting name | Values | Version introduced |
861+
|--------------------------|----------------------------|-----------|--------------------|
862+
| **runtimeconfig.json** | `System.GC.DGen0GrowthPercent` | *decimal value* | .NET 10 |
863+
| **Environment variable** | `DOTNET_GCDGen0GrowthPercent` | *hexadecimal value* | .NET 10 |
864+
865+
[!INCLUDE [runtimehostconfigurationoption](includes/runtimehostconfigurationoption.md)]
866+
867+
So if `f` calculates 0.474 and this setting is 200, the multiplier becomes `0.474 * 200% = 0.948` before the clamping is applied.
868+
869+
- The maximum clamping value in permil.
870+
871+
| | Setting name | Values | Version introduced |
872+
|--------------------------|----------------------------|-----------|--------------------|
873+
| **runtimeconfig.json** | `System.GC.DGen0GrowthMaxFactor` | *decimal value* | .NET 10 |
874+
| **Environment variable** | `DOTNET_GCDGen0GrowthMaxFactor` | *hexadecimal value* | .NET 10 |
875+
876+
[!INCLUDE [runtimehostconfigurationoption](includes/runtimehostconfigurationoption.md)]
877+
878+
If this value is 20000, it means the maximum clamping value is `20000 * 0.001 = 20`.
879+
880+
- The minimum clamping value in permil.
881+
882+
| | Setting name | Values | Version introduced |
883+
|--------------------------|----------------------------|-----------|--------------------|
884+
| **runtimeconfig.json** | `System.GC.DGen0GrowthMinFactor` | *decimal value* | .NET 10 |
885+
| **Environment variable** | `DOTNET_GCDGen0GrowthMinFactor` | *hexadecimal value* | .NET 10 |
886+
887+
[!INCLUDE [runtimehostconfigurationoption](includes/runtimehostconfigurationoption.md)]
888+
889+
If this value is 200, the minimum clamping value is `200 * 0.001 = 0.2`.
890+

0 commit comments

Comments
 (0)