-
Notifications
You must be signed in to change notification settings - Fork 654
Process Threads list and minidump gcdump diagsession
To diagnose issues, one may need to get the list of running processes, their cpu and memory usages, or even take a minidump. Kudu service exposes processes and threads endpoint (/diagnostics/processes
) enabling users to achieve exactly that. If you start at the root of the Kudu service, you'll see a Processes and mini-dumps
link that lets you easily navigate the REST API (a browser extension like JSONView is recommended).
<kudu-service-url>/diagnostics/processes
endpoint returns the list of running processes in json format. Each process info contains process name, id and a link /diagnostics/processes/{id}
to its detail information (such as memory, cpu usages, etc.). Note: the id 0
is reserved for current w3wp.exe
process allowing a shortcut to this via /diagnostics/processes/0
. One can take the minidump of any given process by simply connect to /diagnostics/processes/{id}/dump
. For Windows Azure, we include support for taking a gcdump and diagsession format (/diagnostics/processes/{id}/gcdump&format=raw
and /diagnostics/processes/{id}/gcdump&format=diagsession
respectively).
<kudu-service-url>/diagnostics/processes/{id}/threads
endpoint returns the list of threads for a given process. Each thread info contains id, state and a link /diagnostics/processes/{id}/threads/{tid}
to its detail information (such as memory, cpu usages, etc.).
-
HTTP GET /diagnostics/processes
=> list of processes. -
HTTP GET /diagnostics/processes/{id}
=> detail information of process withid
. -
HTTP GET /diagnostics/processes/{id}/threads
=> list of threads for process withid
. -
HTTP GET /diagnostics/processes/{id}/threads/{tid}
=> detail information of the thread. -
HTTP DELETE /diagnostics/processes/{id}
=> terminate process withid
and its children. -
HTTP GET /diagnostics/processes/0
=> detail process information of currentw3wp.exe
. -
HTTP DELETE /diagnostics/processes/0
=> terminatew3wp.exe
process and its children. -
HTTP GET /diagnostics/processes/{id}/dump
=> minidump of process withid
. By default, this is minimum dump without memory (dumptType=0). -
HTTP GET /diagnostics/processes/{id}/dump?dumpType=2
=> full memory minidump of process withid
. The available dumpType value can be found at MINIDUMP_TYPE. -
HTTP GET /diagnostics/processes/{id}/dump?dumpType=2&format=zip
=> full memory minidump of process withid
. This will include matching sos.dll and mscordackws.dll in the zip package. - (Windows Azure only)
HTTP GET /diagnostics/processes/{id}/gcdump
=> take managed gcdump. This returns a diagsession format file. VS 2013 Ultimate (or newer) is needed to open this type of file. You can also specify different format query string such as?format=raw
(returning in raw gcdump format readable by perfview or?format=zip
to compress the raw gcdump in zip file.
This feature is about getting dumps for running processes, and not for crashed processes.
Since the Kudu service runs in the same w3wp process as the site, w3wp needs to be able to process the dump request. In most cases, it will be, but it's possible for w3wp to be corrupted enough not to be able to handle the request.
If you have an Azure site that's running on multiple instances, the dump request will end up getting sent to an arbitrary instance.
Ideally, the specific instance could be selected, and hopefully it will work that way in the future.
The resources used by the dump feature are counted toward the site limits. For the default small dump, it's not an issue, but if requesting a full dump for a Free Azure site, you could reach the quota which could cause some site downtime.