Skip to content
Dave Cheney edited this page Feb 3, 2016 · 6 revisions

Introduction

Trying to investigate an issue with jujud which is manifesting as high cpu or high memory usage by reading log files is about as productive as diagnosing an issue with your digestive tract by staring at your navel.

For Juju 2.0 and Juju 1.25.4 (or later) a profiling facility has been added to the jujud binary. This page describes the operation of the pprof facility.

No user serviceable parts inside

The pprof profiling facility is very low level. It is not a general purpose profiling or debugging tool. This page does describe how to interpret the information this facility returns, only how to collect data for later analysis.

History

pprof started life as part of the Google Perf Tools toolkit. Around 2010 the Go runtime was enhanced to collect profiling data with the recording of that data left unspecified. Slightly later in 2010 a new package, http/pprof (later renamed to net/http/pprof) was added. net/http/pprof presents a simple http interface to request profiling data from a running Go program.

The profiling support added to jujud is based on this http interface, modified to serve data over a local unix socket rather than tcp. Hopefully this explains the idiosyncratic user interface.

Limitations

This facility is only available on linux platforms.

This facility is only enabled for jujud binaries, what are commonly referred to as machine or unit agents. The facility is not enabled for hook commands although they share the same underlying binary via the argv[0] trick.

Prerequisites

Clone this wiki locally