- System requirements
- Profiler architecture
- Profiler installation
- Uninstall profiler
- Running the profiler
- Profiler activation
- Welcome screen
- Start profiling
- IDE integration
- Profile .NET executable
- Profile ASP.NET application in IIS
- Profile ASP.NET web app on Azure App Service on Linux
- Profile ASP.NET web app on Azure App Service on Windows
- Profile all .NET processes that will start
- Attach profiler to a running application
- Profile remote applications
- Profiling in Docker container
- Profiling in Docker container using port forwarding
- Profiling in Docker container using YourKit Connection Broker
- Manually enable profiling of local applications
- Agent startup options
- Connect to profiled application
- Profiling overhead
- Snapshots
- Solving performance problems
- CPU profiling
- Thread profiling
- Object allocation profiling
- Memory profiling
- Exception profiling
- Telemetry
- Probes: monitor higher level events
- Inspections: automatic recognition of typical problems
- Automatically trigger actions on event
- Automatic deobfuscation
- Summary, automatic deobfuscation
- Filters
- Profiler command line
- Command line tool to control profiling
- Export of profiling results to external formats
- Profiler .NET API
- Profiler HTTP API
- Settings
- Troubleshooting
Agent startup options
Agent startup options are passed to the profiler agent and take effect as soon as the .NET application starts. The options are a comma-separated list. You can specify multiple options by separating them with commas.
Where can I specify the startup options?
- Dialogs shown for the Profile... actions on the Welcome screen have "Advanced startup options...".
- When enabling profiling with the command line tool.
-
If you enable profiling
manually, you can specify
startup options through the environment variable
YNP_STARTUP_OPTIONS
or the registry keyHKEY_LOCAL_MACHINE\SOFTWARE\YNP\STARTUP_OPTIONS
. The environment variable takes priority over the registry key if both are set.
Environment variable substitution
It is possible to use environment variables in the startup options
with the ${VARIABLE}
syntax.
Substitutions are helpful for options which are not known until execution time.
If an environment variable is not set, it will be replaced with an empty string.
For example, if environment variable SNAPSHOT_DIR
is set to /tmp/snapshots
,
then startup option dir=${SNAPSHOT_DIR}
evaluates to
dir=/tmp/snapshots
.
Options file
If you need to specify a lot of agent options, or use same options for multiple projects
you may find useful options_file
option.
In options file you can specify agent options as usual, but also separate them line by line without commas.
Comment lines are denoted by the #
as the first non-blank character,
in which all remaining text on that line is ignored.
And of course you can use environment variables in options file too.
Options file must be in UTF-8 encoding.
Options file example:
# Start with CPU profiling:
sampling
# Start with object allocation profiling:
alloc_each=100,alloc_size_limit=4096
# Snapshot directory is specified via environment variable:
dir=${SNAPSHOT_DIR}
Options
Connectivity |
|
or
|
Specify the port that the profiler agent listens on for communication with the profiler UI. By default, the port is chosen automatically: if port 10001 is free, it is used; otherwise, if port 10002 is free, it is used etc. If no port in the range 10001..10010 is free, an arbitrary free port is used. If port range is specified, profiler will choose first free port in the range. |
listen= <option>
|
Specify the profiler agent connectivity option.
|
ssl_certificate= <path to SSL certificate>
|
File with the SSL certificate in the PEM format. If intermediate certificates should be specified in addition to a primary certificate, they should be specified in the same file in the following order: the primary certificate comes first, then the intermediate certificates.
If the |
ssl_certificate_key= <path to secret key>
|
File with the secret key in the PEM format. |
ssl_password_file= <path to password file>
|
If the secret key |
YourKit Connection Broker options |
|
broker_url= <url>
|
Connection broker URL. |
broker_token= <token>
|
Connection broker access token. |
CPU profiling |
|
sampling |
Immediately start CPU profiling in the sampling mode. Note that you do not have to profile CPU right from the start; instead, in many cases it's better to start or stop measuring at a later moment - from the UI or by using the Profiler API. |
tracing |
Immediately start CPU profiling in the tracing mode. Note that you do not have to profile CPU right from the start; instead, in many cases it's better to start or stop measuring at a later moment - from the UI or by using the Profiler API. |
sampling_settings_path= <file path> |
Specify a custom location of the CPU sampling settings configuration file.
If this option is not specified,
the settings are read from
|
tracing_settings_path= <file path> |
Specify a custom location of the CPU tracing settings configuration file.
If this option is not specified,
the settings are read from
|
Allocation profiling |
|
alloc_each= <N> |
Immediately start object allocation profiling, recording each N-th allocation.
This option can be used in combination with
To record only those objects whose size exceeds the threshold set with Note that you do not have to record allocations right from the start; instead, you can start or stop profiling later from the profiler UI or using Profiler API. |
alloc_size_limit= <size in bytes> |
Immediately start object allocation profiling, recording allocation of all objects with size bigger than or equal to the specified value.
This option can be used in combination with Note that you do not have to record allocations right from the start; instead, you can start or stop profiling later from the profiler UI or using Profiler API. |
Telemetry |
|
telemetry=on |
Immediately start telemetry collection. This is the default mode. |
telemetry=off |
Do not immediately start telemetry collection that can instead be started later in runtime. |
telemetry_limit= <hours> |
The telemetry and thread profiling results are remembered in a circular buffer in the profiler agent memory. This allows you to connect to a profiled application on demand and discover how the application behaved in the past. By default, the telemetry buffer is limited to store approximately 1 hour of recent telemetry data.
With the help of the |
telemetry_period= <milliseconds> |
Specify how often telemetry and thread profiling information is obtained. By default, the period is 1 second (1000 milliseconds). Note that setting smaller period can add overhead. |
Thread profiling |
|
threads=full|states|off
|
The
|
Exception profiling |
|
exceptions=on |
Immediately start the exception profiling. This is the default mode. |
exceptions=off |
Do not immediately start the exception profiling that can instead be started later in runtime. |
exceptions=disable |
Fully disable exception profiling and totally eliminate related overhead. The exception profiling will not be available. |
Snapshots |
|
dir= <directory for snapshots>
|
Specify custom snapshot directory for the particular profiled application |
snapshot_name_format= <format> |
Specify alternate rule to compose snapshot file names. Available macros:
The default format is Characters not allowed in file names, if specified, will be replaced with '-'. |
on_exit=snapshot |
Capture a performance snapshot on profiled application exit. If this option is not specified, the performance snapshot will be captured on exit if CPU profiling or object allocation profiling is running at that moment. |
Triggers |
|
triggers= <file path> |
Specify the file with description of the triggers to be applied from startup.
If this option is not specified, the trigger description is read from
By default, that file does not exist, thus no triggers are applied. |
used_mem= <used memory in megabytes> |
Adds a trigger to automatically capture a memory snapshot when process used memory reaches the threshold. |
periodic_perf= <period in seconds> |
Adds a trigger to periodically capture performance snapshots. |
periodic_mem= <period in seconds> |
Adds a trigger to periodically capture memory snapshots. |
Events and probes |
|
|
Control probes on startup. Read more... |
Miscellaneous |
|
or
|
Specify a path to the options file with agent startup options. Options from the options file will be used as if they were directly specified in its place, in order they are written in the file.
Example:
|
app_name= <name> |
Specify alternate presentable name of the profiled application used in:
If this option is not specified, the application name is automatically chosen based on its executable name.
The default, automatically generated application name can be specified via
For example, to append the host name to the default application name, use
|
log_dir= <directory> |
By default, the profiler agent log file is Use this option to create logs in different directory.
For example, it can be useful when profiling applications running as a Windows service.
They usually run under special user,
thus the logs are located in that special user's home directory.
For example, it can be
Instead, make the logs created in an arbitrary easily accessible directory,
e.g. |
tmp_dir= <directory> |
Specify alternate directory for temporary files created by the profiler agent:
By default, the profiler agent creates the temporary files in the default temporary directory. |
probe_table_length_limit= <rows>
|
Limit the number of rows to be stored by the profiler agent per table. The default value is 100,000. |
dead_thread_limit= <threads> |
Specify the number of recently finished threads for which
profiling results are kept. The default value is 50.
Profiling results for the finished threads beyond this limit are merged to
|
Optimization optionsReduce profiling overhead by disabling some profiling capabilities. |
|
disable_alloc |
Disable object allocation notification events in the runtime to totally eliminate corresponding overhead. Object allocation profiling will not be available. |
disable_tracing |
Disable method enter and leave events in the runtime needed for CPU tracing. CPU tracing will not be available. |
disable_all |
Disable several capabilities at once:
|
disable_inlining |
Forbids CLR to inline any methods. Specify this option to see all method calls and exact stack traces. Please be aware that the profiled application may run up to 10 times slower. Use this option when invocation counts obtained with CPU tracing and stack trace accuracy for all called methods are more valuable than the time accuracy and lower overhead. |
snapshot_download_compression= <option> |
The compression algorithm used when transferring the snapshot:
The default option is |
quiet=true|false |
The
|
verbose |
Increase the level of detail in the agent's log file. When this option is specified, the profiler agent will produce more detailed diagnostic information. |