From 43ea048ad9eb09461d839d38c73d97c700f7e6c0 Mon Sep 17 00:00:00 2001 From: Maoni0 Date: Mon, 22 Sep 2025 13:50:13 -0700 Subject: [PATCH 1/4] DATAS .net 10 configs --- docs/core/runtime-config/garbage-collector.md | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/docs/core/runtime-config/garbage-collector.md b/docs/core/runtime-config/garbage-collector.md index 1fd7afa0f57c5..43f80335983a1 100644 --- a/docs/core/runtime-config/garbage-collector.md +++ b/docs/core/runtime-config/garbage-collector.md @@ -824,3 +824,64 @@ For more information about the first 3 settings, see the [Middle ground between | **runtimeconfig.json** | `System.GC.DynamicAdaptationMode` | `1` - enabled
`0` - disabled | .NET 8 | [!INCLUDE [runtimehostconfigurationoption](includes/runtimehostconfigurationoption.md)] + +#### Target TCP + +DATAS uses the Throughput Cost Percentage (TCP) as the memory cost measurement on throughput. It takes both GC pauses and how much allocations have to wait into consideration. Usually the former dominates so you can use the "% pause time in GC" to approximate this cost. There are 2 transient cases where the latter dominates - + +- When a process starts, DATAS always starts with one heap so if there are enough threads allocating they experience waits. +- When the workload changes from lighter to heavier, eg, when peak hours start, since it takes a few GCs before the number of heaps gets increased, allocating threads may experience waits during that period of time. + +DATAS uses 2% as the default TCP which can be adjusted with this setting. It's an integer that is interpreted as a percentage, eg, 5 means the target TCP will be 5%. + +| | Setting name | Values | Version introduced | +|--------------------------|----------------------------|-----------|--------------------| +| **runtimeconfig.json** | `System.GC.DTargetTCP` | *decimal value* | .NET 9 | +| **Environment variable** | `DOTNET_GCDTargetTCP` | *hexadecimal value* | .NET 9 | + +[!INCLUDE [runtimehostconfigurationoption](includes/runtimehostconfigurationoption.md)] + +#### Gen0 max budget settings + +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. We use this formula to calculate a multiplier + +`f (application_size_in_MB) = (20 - conserve_memory) / sqrt (application_size_in_MB)` + +which 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. And the maximum and minimum value are default to 10 and 0.1. + +For example, if the application size is 1 GB, the formula gives us `(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 give us 15 which would then be adjusted to 10, meaning the total gen0 budget allowed is 10 MB. + +3 settings are provided to adjust what the formula calculates and modify the clamping values: + +- The percent that will be applied to what `f` calculates + +| | Setting name | Values | Version introduced | +|--------------------------|----------------------------|-----------|--------------------| +| **runtimeconfig.json** | `System.GC.DGen0GrowthPercent` | *decimal value* | .NET 10 | +| **Environment variable** | `DOTNET_GCDGen0GrowthPercent` | *hexadecimal value* | .NET 10 | + +[!INCLUDE [runtimehostconfigurationoption](includes/runtimehostconfigurationoption.md)] + +So if `f` calculates 0.474 and this setting is 200, it means the multiplier will become `0.474 * 200% = 0.948` before the clamping is applied. + +- The maximum clamping value in permil + +| | Setting name | Values | Version introduced | +|--------------------------|----------------------------|-----------|--------------------| +| **runtimeconfig.json** | `System.GC.DGen0GrowthMaxFactor` | *decimal value* | .NET 10 | +| **Environment variable** | `DOTNET_GCDGen0GrowthMaxFactor` | *hexadecimal value* | .NET 10 | + +[!INCLUDE [runtimehostconfigurationoption](includes/runtimehostconfigurationoption.md)] + +If this value is 20000, it means the maximum clamping value is `20000 * 0.001 = 20`. + +- The minimum clamping value in permil + +| | Setting name | Values | Version introduced | +|--------------------------|----------------------------|-----------|--------------------| +| **runtimeconfig.json** | `System.GC.DGen0GrowthMinFactor` | *decimal value* | .NET 10 | +| **Environment variable** | `DOTNET_GCDGen0GrowthMinFactor` | *hexadecimal value* | .NET 10 | + +[!INCLUDE [runtimehostconfigurationoption](includes/runtimehostconfigurationoption.md)] + +If this value is 200, it means the minimum clamping value is `200 * 0.001 = 0.2`. From 6cbb8ff4d32d45c99c1ed29ebb61e382b6477ee3 Mon Sep 17 00:00:00 2001 From: Maoni0 Date: Mon, 22 Sep 2025 14:03:14 -0700 Subject: [PATCH 2/4] fixed lint errors --- docs/core/runtime-config/garbage-collector.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/core/runtime-config/garbage-collector.md b/docs/core/runtime-config/garbage-collector.md index 43f80335983a1..08d869b98f03e 100644 --- a/docs/core/runtime-config/garbage-collector.md +++ b/docs/core/runtime-config/garbage-collector.md @@ -841,13 +841,13 @@ DATAS uses 2% as the default TCP which can be adjusted with this setting. It's a [!INCLUDE [runtimehostconfigurationoption](includes/runtimehostconfigurationoption.md)] -#### Gen0 max budget settings +#### Gen0 max budget settings -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. We use this formula to calculate a multiplier +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. We use this formula to calculate a multiplier - `f (application_size_in_MB) = (20 - conserve_memory) / sqrt (application_size_in_MB)` -which 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. And the maximum and minimum value are default to 10 and 0.1. +which 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. And the maximum and minimum value are default to 10 and 0.1. For example, if the application size is 1 GB, the formula gives us `(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 give us 15 which would then be adjusted to 10, meaning the total gen0 budget allowed is 10 MB. @@ -873,7 +873,7 @@ So if `f` calculates 0.474 and this setting is 200, it means the multiplier will [!INCLUDE [runtimehostconfigurationoption](includes/runtimehostconfigurationoption.md)] -If this value is 20000, it means the maximum clamping value is `20000 * 0.001 = 20`. +If this value is 20000, it means the maximum clamping value is `20000 * 0.001 = 20`. - The minimum clamping value in permil @@ -884,4 +884,4 @@ If this value is 20000, it means the maximum clamping value is `20000 * 0.001 = [!INCLUDE [runtimehostconfigurationoption](includes/runtimehostconfigurationoption.md)] -If this value is 200, it means the minimum clamping value is `200 * 0.001 = 0.2`. +If this value is 200, it means the minimum clamping value is `200 * 0.001 = 0.2`. From dbfd8f9582ee4f8acf4b21fb3af622ba0f1786bb Mon Sep 17 00:00:00 2001 From: Maoni0 Date: Mon, 22 Sep 2025 16:41:52 -0700 Subject: [PATCH 3/4] CR feedback --- docs/core/runtime-config/garbage-collector.md | 70 ++++++++++--------- 1 file changed, 36 insertions(+), 34 deletions(-) diff --git a/docs/core/runtime-config/garbage-collector.md b/docs/core/runtime-config/garbage-collector.md index 08d869b98f03e..a87967cafc26c 100644 --- a/docs/core/runtime-config/garbage-collector.md +++ b/docs/core/runtime-config/garbage-collector.md @@ -827,12 +827,12 @@ For more information about the first 3 settings, see the [Middle ground between #### Target TCP -DATAS uses the Throughput Cost Percentage (TCP) as the memory cost measurement on throughput. It takes both GC pauses and how much allocations have to wait into consideration. Usually the former dominates so you can use the "% pause time in GC" to approximate this cost. There are 2 transient cases where the latter dominates - +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: -- When a process starts, DATAS always starts with one heap so if there are enough threads allocating they experience waits. -- When the workload changes from lighter to heavier, eg, when peak hours start, since it takes a few GCs before the number of heaps gets increased, allocating threads may experience waits during that period of time. +- When a process starts, DATAS always starts with one heap. So if there are enough threads allocating, they experience waits. +- 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. -DATAS uses 2% as the default TCP which can be adjusted with this setting. It's an integer that is interpreted as a percentage, eg, 5 means the target TCP will be 5%. +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%. | | Setting name | Values | Version introduced | |--------------------------|----------------------------|-----------|--------------------| @@ -843,45 +843,47 @@ DATAS uses 2% as the default TCP which can be adjusted with this setting. It's a #### Gen0 max budget settings -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. We use this formula to calculate a multiplier - +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: -`f (application_size_in_MB) = (20 - conserve_memory) / sqrt (application_size_in_MB)` +$$ +f(\text{application\_size\_in\_MB}) = \frac{20 - \text{conserve\_memory}}{\sqrt{\text{application\_size\_in\_MB}}} +$$ -which 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. And the maximum and minimum value are default to 10 and 0.1. +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. -For example, if the application size is 1 GB, the formula gives us `(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 give us 15 which would then be adjusted to 10, meaning the total gen0 budget allowed is 10 MB. +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. -3 settings are provided to adjust what the formula calculates and modify the clamping values: +Three settings are provided to adjust what the formula calculates and modify the clamping values: -- The percent that will be applied to what `f` calculates +- The percent that will be applied to what `f` calculates. -| | Setting name | Values | Version introduced | -|--------------------------|----------------------------|-----------|--------------------| -| **runtimeconfig.json** | `System.GC.DGen0GrowthPercent` | *decimal value* | .NET 10 | -| **Environment variable** | `DOTNET_GCDGen0GrowthPercent` | *hexadecimal value* | .NET 10 | + | | Setting name | Values | Version introduced | + |--------------------------|----------------------------|-----------|--------------------| + | **runtimeconfig.json** | `System.GC.DGen0GrowthPercent` | *decimal value* | .NET 10 | + | **Environment variable** | `DOTNET_GCDGen0GrowthPercent` | *hexadecimal value* | .NET 10 | + + [!INCLUDE [runtimehostconfigurationoption](includes/runtimehostconfigurationoption.md)] + + So if `f` calculates 0.474 and this setting is 200, the multiplier becomes `0.474 * 200% = 0.948` before the clamping is applied. -[!INCLUDE [runtimehostconfigurationoption](includes/runtimehostconfigurationoption.md)] +- The maximum clamping value in permil. -So if `f` calculates 0.474 and this setting is 200, it means the multiplier will become `0.474 * 200% = 0.948` before the clamping is applied. + | | Setting name | Values | Version introduced | + |--------------------------|----------------------------|-----------|--------------------| + | **runtimeconfig.json** | `System.GC.DGen0GrowthMaxFactor` | *decimal value* | .NET 10 | + | **Environment variable** | `DOTNET_GCDGen0GrowthMaxFactor` | *hexadecimal value* | .NET 10 | -- The maximum clamping value in permil + [!INCLUDE [runtimehostconfigurationoption](includes/runtimehostconfigurationoption.md)] -| | Setting name | Values | Version introduced | -|--------------------------|----------------------------|-----------|--------------------| -| **runtimeconfig.json** | `System.GC.DGen0GrowthMaxFactor` | *decimal value* | .NET 10 | -| **Environment variable** | `DOTNET_GCDGen0GrowthMaxFactor` | *hexadecimal value* | .NET 10 | - -[!INCLUDE [runtimehostconfigurationoption](includes/runtimehostconfigurationoption.md)] + If this value is 20000, it means the maximum clamping value is `20000 * 0.001 = 20`. -If this value is 20000, it means the maximum clamping value is `20000 * 0.001 = 20`. - -- The minimum clamping value in permil - -| | Setting name | Values | Version introduced | -|--------------------------|----------------------------|-----------|--------------------| -| **runtimeconfig.json** | `System.GC.DGen0GrowthMinFactor` | *decimal value* | .NET 10 | -| **Environment variable** | `DOTNET_GCDGen0GrowthMinFactor` | *hexadecimal value* | .NET 10 | - -[!INCLUDE [runtimehostconfigurationoption](includes/runtimehostconfigurationoption.md)] +- The minimum clamping value in permil. -If this value is 200, it means the minimum clamping value is `200 * 0.001 = 0.2`. + | | Setting name | Values | Version introduced | + |--------------------------|----------------------------|-----------|--------------------| + | **runtimeconfig.json** | `System.GC.DGen0GrowthMinFactor` | *decimal value* | .NET 10 | + | **Environment variable** | `DOTNET_GCDGen0GrowthMinFactor` | *hexadecimal value* | .NET 10 | + + [!INCLUDE [runtimehostconfigurationoption](includes/runtimehostconfigurationoption.md)] + + If this value is 200, the minimum clamping value is `200 * 0.001 = 0.2`. \ No newline at end of file From 466fa38382780a51ead3fccfcca407b7f3344ad7 Mon Sep 17 00:00:00 2001 From: Maoni0 Date: Mon, 22 Sep 2025 16:47:12 -0700 Subject: [PATCH 4/4] lint error --- docs/core/runtime-config/garbage-collector.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/core/runtime-config/garbage-collector.md b/docs/core/runtime-config/garbage-collector.md index a87967cafc26c..9847e61e60e96 100644 --- a/docs/core/runtime-config/garbage-collector.md +++ b/docs/core/runtime-config/garbage-collector.md @@ -886,4 +886,5 @@ Three settings are provided to adjust what the formula calculates and modify the [!INCLUDE [runtimehostconfigurationoption](includes/runtimehostconfigurationoption.md)] - If this value is 200, the minimum clamping value is `200 * 0.001 = 0.2`. \ No newline at end of file + If this value is 200, the minimum clamping value is `200 * 0.001 = 0.2`. + \ No newline at end of file