Skip to content

Run-time config knobs #16019

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Dec 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions docs/core/run-time-config/compilation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
title: Compilation config settings
description: Learn about run-time settings that configure how the JIT compiler works for .NET Core apps.
ms.date: 11/27/2019
ms.topic: reference
---
# Run-time configuration options for compilation

## Tiered compilation

- Configures whether the JIT compiler uses [tiered compilation](../whats-new/dotnet-core-3-0.md#tiered-compilation).
- In .NET Core 3.0 and later, tiered compilation is enabled by default.
- In .NET Core 2.1 and 2.2, tiered compilation is disabled by default.

| | Setting name | Values |
| - | - | - |
| **runtimeconfig.json** | `System.Runtime.TieredCompilation` | `true` - enabled<br/>`false` - disabled |
| **Environment variable** | `COMPlus_TieredCompilation` | `1` - enabled<br/>`0` - disabled |
68 changes: 68 additions & 0 deletions docs/core/run-time-config/debugging-profiling.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
title: Debugging profiling config settings
description: Learn about run-time settings that configure debugging and profiling for .NET Core apps.
ms.date: 11/27/2019
ms.topic: reference
---
# Run-time configuration options for debugging and profiling

## Enable diagnostics

- Configures whether the debugger, the profiler, and EventPipe diagnostics are enabled or disabled.
- Default: Enabled (`1`).

| | Setting name | Values |
| - | - | - |
| **runtimeconfig.json** | N/A | N/A |
| **Environment variable** | `COMPlus_EnableDiagnostics` | `1` - enabled<br/>`0` - disabled |

## Enable profiling

- Configures whether profiling is enabled for the currently running process.
- Default: Disabled (`0`).

| | Setting name | Values |
| - | - | - |
| **runtimeconfig.json** | N/A | N/A |
| **Environment variable** | `CORECLR_ENABLE_PROFILING` | `0` - disabled<br/>`1` - enabled |

## Profiler GUID

- Specifies the GUID of the profiler to load into the currently running process.

| | Setting name | Values |
| - | - | - |
| **runtimeconfig.json** | N/A | N/A |
| **Environment variable** | `CORECLR_PROFILER` | *string-guid* |

## Profiler location

- Specifies the path to the profiler DLL to load into the currently running process (or 32-bit or 64-bit process).
- If more than one variable is set, the bitness-specific variables take precedence. They specify which bitness of profiler to load.
- For more information, see [Finding the profiler library](https://github.com/dotnet/runtime/blob/master/docs/design/coreclr/profiling/Profiler%20Loading.md).

| | Setting name | Values |
| - | - | - |
| **Environment variable** | `CORECLR_PROFILER_PATH` | *string-path* |
| **Environment variable** | `CORECLR_PROFILER_PATH_32` | *string-path* |
| **Environment variable** | `CORECLR_PROFILER_PATH_64` | *string-path* |

## Write perf map

- Enables or disables writing */tmp/perf-$pid.map* on Linux systems.
- Default: Disabled (`0`).

| | Setting name | Values |
| - | - | - |
| **runtimeconfig.json** | N/A | N/A |
| **Environment variable** | `COMPlus_PerfMapEnabled` | `0` - disabled<br/>`1` - enabled |

## Perf log markers

- When `COMPlus_PerfMapEnabled` is set to `1`, enables or disables the specified signal to be accepted and ignored as a marker in the perf logs.
- Default: Disabled (`0`).

| | Setting name | Values |
| - | - | - |
| **runtimeconfig.json** | N/A | N/A |
| **Environment variable** | `COMPlus_PerfMapIgnoreSignal` | `0` - disabled<br/>`1` - enabled |
7 changes: 7 additions & 0 deletions docs/core/run-time-config/desktop.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[LocalizedFileNames]
compilation.md=@compilation.md,0
threading.md=@threading.md,0
profiling.md=@profiling.md,0
networking.md=@networking.md,0
globalization.md=@globalization.md,0
debugging.md=@debugging.md,0
22 changes: 11 additions & 11 deletions docs/core/run-time-config/garbage-collector.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Garbage collector config settings
description: Learn about run-time settings for configuring how the garbage collector manages memory.
description: Learn about run-time settings for configuring how the garbage collector manages memory for .NET Core apps.
ms.date: 11/13/2019
ms.topic: reference
---
Expand Down Expand Up @@ -32,7 +32,7 @@ Use the following settings to select flavors of garbage collection:
| | Setting name | Values | Version introduced |
| - | - | - | - |
| **runtimeconfig.json** | `System.GC.Server` | `false` - workstation<br/>`true` - server | .NET Core 1.0 |
| **Environment variable** | `COMPlus_gcServer` | 0 - workstation<br/>1 - server | .NET Core 1.0 |
| **Environment variable** | `COMPlus_gcServer` | `0` - workstation<br/>`1` - server | .NET Core 1.0 |
| **app.config for .NET Framework** | [GCServer](../../framework/configure-apps/file-schema/runtime/gcserver-element.md) | `false` - workstation<br/>`true` - server | |

### System.GC.Concurrent/COMPlus_gcConcurrent
Expand Down Expand Up @@ -104,13 +104,13 @@ For more information about some of these settings, see the [Middle ground betwee
When a 64-bit Windows computer has multiple CPU groups, that is, there are more than 64 processors, enabling this element extends garbage collection across all CPU groups. The garbage collector uses all cores to create and balance heaps.

- Applies to server garbage collection (GC) on 64-bit Windows operation systems only.
- Default: Disabled (0).
- Default: Disabled (`0`).
- For more information, see [Making CPU configuration better for GC on machines with > 64 CPUs](https://devblogs.microsoft.com/dotnet/making-cpu-configuration-better-for-gc-on-machines-with-64-cpus/) on Maoni Stephens' blog.

| | Setting name | Values | Version introduced |
| - | - | - | - |
| **runtimeconfig.json** | N/A | N/A | N/A |
| **Environment variable** | `COMPlus_GCCpuGroup` | 0 - disabled<br/>1 - enabled | .NET Core 1.0 |
| **Environment variable** | `COMPlus_GCCpuGroup` | `0` - disabled<br/>`1` - enabled | .NET Core 1.0 |
| **app.config for .NET Framework** | [GCCpuGroup](../../framework/configure-apps/file-schema/runtime/gccpugroup-element.md) | `false` - disabled<br/>`true` - enabled | |

> [!NOTE]
Expand All @@ -125,7 +125,7 @@ For more information about some of these settings, see the [Middle ground betwee
| | Setting name | Values | Version introduced |
| - | - | - | - |
| **runtimeconfig.json** | `System.GC.NoAffinitize` | `false` - affinitize<br/>`true` - don't affinitize | .NET Core 3.0 |
| **Environment variable** | `COMPlus_GCNoAffinitize` | 0 - affinitize<br/>1 - don't affinitize | .NET Core 3.0 |
| **Environment variable** | `COMPlus_GCNoAffinitize` | `0` - affinitize<br/>`1` - don't affinitize | .NET Core 3.0 |
| **app.config for .NET Framework** | [GCNoAffinitize](../../framework/configure-apps/file-schema/runtime/gcnoaffinitize-element.md) | `false` - affinitize<br/>`true` - don't affinitize | 4.6.2 |

### System.GC.HeapHardLimit/COMPlus_GCHeapHardLimit
Expand Down Expand Up @@ -160,34 +160,34 @@ For more information about some of these settings, see the [Middle ground betwee
| | Setting name | Values | Version introduced |
| - | - | - | - |
| **runtimeconfig.json** | `System.GC.RetainVM` | `false` - release to OS<br/>`true` - put on standby| .NET Core 1.0 |
| **Environment variable** | `COMPlus_GCRetainVM` | 0 - release to OS<br/>1 - put on standby | .NET Core 1.0 |
| **Environment variable** | `COMPlus_GCRetainVM` | `0` - release to OS<br/>`1` - put on standby | .NET Core 1.0 |

## Large pages

### COMPlus_GCLargePages

- Specifies whether large pages should be used when a heap hard limit is set.
- Default: Disabled (0).
- Default: Disabled (`0`).
- This is an experimental setting.

| | Setting name | Values | Version introduced |
| - | - | - | - |
| **runtimeconfig.json** | N/A | N/A | N/A |
| **Environment variable** | `COMPlus_GCLargePages` | 0 - disabled<br/>1 - enabled | .NET Core 3.0 |
| **Environment variable** | `COMPlus_GCLargePages` | `0` - disabled<br/>`1` - enabled | .NET Core 3.0 |

## Large objects

### COMPlus_gcAllowVeryLargeObjects

- Configures garbage collector support on 64-bit platforms for arrays that are greater than 2 gigabytes (GB) in total size.
- Default: Enabled (1).
- Default: Enabled (`1`).
- This option may become obsolete in a future version of .NET.

| | Setting name | Values | Version introduced |
| - | - | - | - |
| **runtimeconfig.json** | N/A | N/A | N/A |
| **Environment variable** | `COMPlus_gcAllowVeryLargeObjects` | 1 - enabled<br/> 0 - disabled | .NET Core 1.0 |
| **app.config for .NET Framework** | [gcAllowVeryLargeObjects](../../framework/configure-apps/file-schema/runtime/gcallowverylargeobjects-element.md) | 1 - enabled<br/> 0 - disabled | .NET Framework 4.5 |
| **Environment variable** | `COMPlus_gcAllowVeryLargeObjects` | `1` - enabled<br/> `0` - disabled | .NET Core 1.0 |
| **app.config for .NET Framework** | [gcAllowVeryLargeObjects](../../framework/configure-apps/file-schema/runtime/gcallowverylargeobjects-element.md) | `1` - enabled<br/> `0` - disabled | .NET Framework 4.5 |

## Large object heap threshold

Expand Down
51 changes: 51 additions & 0 deletions docs/core/run-time-config/globalization.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
title: Globalization config settings
description: Learn about run-time settings that configure globalization aspects of a .NET Core app, for example, how it parses Japanese dates.
ms.date: 11/27/2019
ms.topic: reference
---
# Run-time configuration options for globalization

## Invariant mode

- Determines whether a .NET Core app runs in globalization invariant mode without access to culture-specific data and behavior or whether it has access to cultural data.
- Default: Run the app with access to cultural data (`false`).
- For more information, see [.NET Core globalization invariant mode](https://github.com/dotnet/corefx/blob/master/Documentation/architecture/globalization-invariant-mode.md).

| | Setting name | Values |
| - | - | - |
| **runtimeconfig.json** | `System.Globalization.Invariant` | `false` - access to cultural data<br/>`true` - run in invariant mode |
| **Environment variable** | `DOTNET_SYSTEM_GLOBALIZATION_INVARIANT` | `0` - access to cultural data<br/>`1` - run in invariant mode |

## Era year ranges

- Determines whether range checks for calendars that support multiple eras are relaxed or whether dates that overflow an era's date range throw an <xref:System.ArgumentOutOfRangeException>.
- Default: Range checks are relaxed (`false`).
- For more information, see [Calendars, eras, and date ranges: Relaxed range checks](../../standard/datetime/working-with-calendars.md#calendars-eras-and-date-ranges-relaxed-range-checks).

| | Setting name | Values |
| - | - | - |
| **runtimeconfig.json** | `Switch.System.Globalization.EnforceJapaneseEraYearRanges` | `false` - relaxed range checks<br/>`true` - overflows cause an exception |
| **Environment variable** | N/A | N/A |

## Japanese date parsing

- Determines whether a string that contains either "1" or "Gannen" as the year parses successfully or whether only "1" is supported.
- Default: Parse strings that contain either "1" or "Gannen" as the year (`false`).
- For more information, see [Represent dates in calendars with multiple eras](../../standard/datetime/working-with-calendars.md#represent-dates-in-calendars-with-multiple-eras).

| | Setting name | Values |
| - | - | - |
| **runtimeconfig.json** | `Switch.System.Globalization.EnforceLegacyJapaneseDateParsing` | `false` - "Gannen" or "1" is supported<br/>`true` - only "1" is supported |
| **Environment variable** | N/A | N/A |

## Japanese year format

- Determines whether the first year of a Japanese calendar era is formatted as "Gannen" or as a number.
- Default: Format the first year as "Gannen" (`false`).
- For more information, see [Represent dates in calendars with multiple eras](../../standard/datetime/working-with-calendars.md#represent-dates-in-calendars-with-multiple-eras).

| | Setting name | Values |
| - | - | - |
| **runtimeconfig.json** | `Switch.System.Globalization.FormatJapaneseFirstYearAsANumber` | `false` - format as "Gannen"<br/>`true` - format as number |
| **Environment variable** | N/A | N/A |
4 changes: 2 additions & 2 deletions docs/core/run-time-config/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ ms.date: 11/13/2019

- [Environment variables](#environment-variables)

The articles in this section of the documentation include are organized by category, for example, debugging and garbage collection. Available configuration options are shown for *runtimeconfig.json* (.NET Core only), *app.config* (.NET Framework only), and environment variables.
The articles in this section of the documentation include are organized by category, for example, debugging and garbage collection. Where applicable, configuration options are shown for *runtimeconfig.json* (.NET Core only), *app.config* (.NET Framework only), and environment variables.

## runtimeconfig.json

Specify run-time configuration options in the **configProperties** section of the *runtimeconfig.json* file. This section has the form:
Specify run-time configuration options in the **configProperties** section of the app's *runtimeconfig.json* file. This section has the form:

```json
{
Expand Down
29 changes: 29 additions & 0 deletions docs/core/run-time-config/networking.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
title: Networking config settings
description: Learn about run-time settings that configure networking for .NET Core apps.
ms.date: 11/27/2019
ms.topic: reference
---
# Run-time configuration options for networking

## HTTP/2 protocol

- Configures whether support for the HTTP/2 protocol is enabled.
- Default: Disabled (`false`).
- Introduced in .NET Core 3.0.

| | Setting name | Values |
| - | - |
| **runtimeconfig.json** | `System.Net.Http.SocketsHttpHandler.Http2Support` | `false` - disabled<br/>`true` - enabled |
| **Environment variable** | `DOTNET_SYSTEM_NET_HTTP_SOCKETSHTTPHANDLER_HTTP2SUPPORT` | `0` - disabled<br/>`1` - enabled |

## Sockets HTTP handler
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are removing these settings for .NET 5. Can we update the docs for this?

cc @ManickaP

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We aren't supposed to talk about future functionality in docs, so I don't think we need to mention it yet.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the right way to track updating the docs with this info once .NET 5 ships?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I created an issue here and labeled it with a new label, Release: .NET 5. @mairaw Please advise if I should do something different instead.


- Configures whether high-level networking APIs, such as <xref:System.Net.Http.HttpClient>, use <xref:System.Net.Http.SocketsHttpHandler?displayProperty=nameWithType> or the implementation of <xref:System.Net.Http.HttpClientHandler?displayProperty=nameWithType> that's based on [libcurl](https://curl.haxx.se/libcurl/).
- Default: Use <xref:System.Net.Http.SocketsHttpHandler?displayProperty=nameWithType> (`true`).
- You can configure this setting programmatically by calling the <xref:System.AppContext.SetSwitch%2A?displayProperty=nameWithType> method.

| | Setting name | Values |
| - | - | - |
| **runtimeconfig.json** | `System.Net.Http.UseSocketsHttpHandler` | `true` - enables the use of <xref:System.Net.Http.SocketsHttpHandler><br/>`false` - enables the use of <xref:System.Net.Http.HttpClientHandler> |
| **Environment variable** | `DOTNET_SYSTEM_NET_HTTP_USESOCKETSHTTPHANDLER` | `1` - enables the use of <xref:System.Net.Http.SocketsHttpHandler><br/>`0` - enables the use of <xref:System.Net.Http.HttpClientHandler> |
37 changes: 37 additions & 0 deletions docs/core/run-time-config/threading.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
title: Threading config settings
description: Learn about run-time settings that configure threading for .NET Core apps.
ms.date: 11/27/2019
ms.topic: reference
---
# Run-time configuration options for threading

## CPU groups

- Configures whether threads are automatically distributed across CPU groups.
- Default: Disabled (`0`).

| | Setting name | Values |
| - | - | - |
| **runtimeconfig.json** | N/A | N/A |
| **Environment variable** | `COMPlus_Thread_UseAllCpuGroups` | `0` - disabled<br/>`1` - enabled |

## Minimum threads

- Specifies the minimum number of threads for the worker threadpool.
- Corresponds to the <xref:System.Threading.ThreadPool.SetMinThreads%2A?displayProperty=nameWithType> method.

| | Setting name | Values |
| - | - | - |
| **runtimeconfig.json** | `System.Threading.ThreadPool.MinThreads` | An integer that represents the minimum number of threads |
| **Environment variable** | N/A | N/A |

## Maximum threads

- Specifies the maximum number of threads for the worker threadpool.
- Corresponds to the <xref:System.Threading.ThreadPool.SetMaxThreads%2A?displayProperty=nameWithType> method.

| | Setting name | Values |
| - | - | - |
| **runtimeconfig.json** | `System.Threading.ThreadPool.MaxThreads` | An integer that represents the maximum number of threads |
| **Environment variable** | N/A | N/A |
10 changes: 10 additions & 0 deletions docs/core/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,18 @@
items:
- name: Settings
href: run-time-config/index.md
- name: Compilation settings
href: run-time-config/compilation.md
- name: Debugging and profiling settings
href: run-time-config/debugging-profiling.md
- name: Garbage collector settings
href: run-time-config/garbage-collector.md
- name: Globalization settings
href: run-time-config/globalization.md
- name: Networking settings
href: run-time-config/networking.md
- name: Threading settings
href: run-time-config/threading.md
- name: Native interoperability
items:
- name: Expose .NET Core components to COM
Expand Down
Loading