I am looking at my performance profile of one of my slowest requests, and I see an AWAIT_TIME of more than 6 seconds, but I am not able to get any more information regarding it. How do I figure out what exactly the process is "waiting on"?
From Azure's documentation:
AWAIT_TIME
indicates the code is waiting for another task to complete. This typically happens with C# 'await' statement. When the code does a C# 'await', the thread unwinds and returns control to the thread-pool, and there is no thread that is blocked waiting for the 'await' to finish. However, logically the thread that did the await is 'blocked' waiting for the operation to complete. The AWAIT_TIME
indicates the blocked time waiting for the task to complete.+
BLOCKED_TIME
indicates the code is waiting for another resource to be available, such as waiting for a synchronization object, waiting for a thread to be available, or waiting for a request to finish.
So it's waiting on something necessary to continue with processing. We have had the same problem of long AWAIT_TIME
with file uploads and it turned out the request was waiting for the Request's stream to be read (ReadAsMultiPartAsync()
for us)... If you look at the code in RecASPRequest
and _RtlUserThreadStart
, you'll probably the culprit...