We are developing an app service over Azure with Web API and .NET framework 4.6.2. We're doing some load test and these are giving us some spikes.
If we go deep in the transactions that are returning these spikes, we can see this:
As you can see, after returning the response (we check this with an event just before the return) there is a lot of time wasted in something. What is this something and how can we avoid it?
Less times this wasted time happens before processing the request as you can see here:
Going even deeper (but in others requests), into the profiler traces, we find "Unmanaged Async". But we don't understand very well what is that and the way to avoid it. Can this "Unmanaged Async" be the cause of the wasted time?