N
N
NameOf Var2020-07-03 13:42:11
ASP.NET
NameOf Var, 2020-07-03 13:42:11

What tools can you recommend for profiling ASP.NET Core applications in docker?

Hello! There was a need to study the performance of individual endpoints in an ASP.NET Core Web API running in a docker container. It is necessary to study which methods consume the most CPU / RAM and which methods are most executed. The docker container is located in Kubernetes on a remote machine.
Now I'm considering the following options:
1) dotTrace. I tried to run through dotTrace.sh inside the container and read the snapshot through Rider. The snapshot turned out to be not very informative (although maybe I just opened it somehow wrong :))
2) dotnet-trace.
3) Visual Studio Performance Profiler - I have not yet figured out how to connect to a remote process in docker in VS Community 2019.

Can you tell me which tool is worth spending more time to study? Which one will give me the stats I need?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladimir Korotenko, 2020-07-03
@hax

Look in this direction
https://2017.dotnext-moscow.ru/2017/msk/talks/2dfo...
My choice
https://miniprofiler.com/

V
Vasily Bannikov, 2020-07-03
@vabka

The docker container is located in Kubernetes on a remote machine.

This complicates everything. Usually, it is not worth profiling in production - it is better to write load tests and run in a development environment
As an option for dotnet-trace
  1. The base image in docker must be SDK 3.0+
  2. Installing dotnet-trace in docker
    RUN dotnet tool install --global dotnet-trace
    ENV PATH $PATH:/root/.dotnet/tools

  3. After running the application in a container (write to the console in docker):
    dotnet-trace collect --process-id $(pidof dotnet) --providers Microsoft-DotNETCore-SampleProfiler

  4. When everything - press Ctrl + C, in the folder with the application there will be a file trace.nettrace

https://stackoverflow.com/questions/59364119/netc...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question