pprof and Remote Servers

In mid-2006, we added an experimental facility to pprof, the tool that analyzes CPU and heap profiles. This facility allows you to collect profile information from running applications. It makes it easy to collect profile information without having to stop the program first, and without having to log into the machine where the application is running. This is meant to be used on webservers, but will work on any application that can be modified to accept TCP connections on a port of its choosing, and to respond to HTTP requests on that port.

We do not currently have infrastructure, such as apache modules, that you can pop into a webserver or other application to get the necessary functionality "for free." However, it's easy to generate the necessary data, which should allow the interested developer to add the necessary support into his or her applications.

To use pprof in this experimental "server" mode, you give the script a host and port it should query, replacing the normal commandline arguments of application + profile file:

   % pprof internalweb.mycompany.com:80

The host must be listening on that port, and be able to accept HTTP/1.0 requests -- sent via wget and curl -- for several urls. The following sections list the urls that pprof can send, and the responses it expects in return.