App Insights Profiler doubles memory consumption

Tomáš Smola 0 Reputation points
2024-10-29T13:24:57.9733333+00:00

Hi,
I have a question regarding App Insights Profiler.

We've configured our app according to this tutorial and locally (run from VS or in a Docker container) everything works fine (there are API metrics in Portal, profiling sessions, code optimizations etc.), it consumes a little bit more memory, but I see no spikes. When deployed to the dev environment (kubernetes cluster) the memory usage goes bananas during profiling sessions and the app consumes twice the usual amount of memory. Also, it seems there are way too many sampling profiling sessions, it is not rare to see 20 per hour.User's image

The documentation says that the sampling profiling sessions are scheduled once an hour and that when Profiler is active the overhead is up to 15%.

I'm not able to find any relevant info to this. Thanks for any additional questions or help in advance.

Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
3,663 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Anonymous
    2024-11-01T07:43:28.4966667+00:00

    Hi @Tomáš Smola
    It's possible that the increased memory usage and number of sampling profiling sessions you are seeing in your dev environment with App Insights Profiler is due to the differences in the environment compared to your local development environment. Here are a few things you can check to troubleshoot the issue:

    Check the resource limits for your Kubernetes cluster. If the cluster does not have enough resources (CPU, memory, etc.) to support the App Insights Profiler, it may cause performance issues and increased memory usage.

    Verify that the App Insights Profiler is configured correctly in your Kubernetes environment. Make sure that the environment variables and configuration settings are set correctly and that the profiler is running as expected.

    Check the logs and metrics for your Kubernetes environment to see if there are any issues or errors related to the App Insights Profiler. You can use tools like Kibana or Grafana to view the logs and metrics.

    Verify that the sampling rate for the App Insights Profiler is set correctly. If the sampling rate is too high, it can cause excessive profiling sessions and increased memory usage. You can adjust the sampling rate by setting the APPLICATIONINSIGHTS_PROFILER_SAMPLING_RATE environment variable.

    1. Consider using other profiling tools or techniques to diagnose performance issues in your Kubernetes environment. App Insights Profiler is just one tool that you can use to diagnose performance issues, and it may not be the best tool for every situation.

    If you have any further queries, do let us know. If the Answer is helpful, please click "Accept Answer".


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.