Deployment with a Profiler
  • Dark
    Light

Deployment with a Profiler

  • Dark
    Light

Overview

You can use this document to learn how to deploy the Edge Delta Agent with a profiler.

The Edge Delta Agent is a Go-based binary that (when specified during deployment) can expose CPU and memory profiling information.

This information can be useful to understand specific activity, such as understanding why CPU usage is high.

After deployment, to obtain the data, you can run a command to download a report.


Deploy the Agent with a Profiler

Note

You can only add a profiler while you deploy an agent.

You cannot add a profiler to an existing agent deployment.

To deploy the agent with a profiler, follow the regular installation instructions for each agent type; however, you must add PROFILER_PORT for port 6060 to the installation command.

Review the following examples.

Note

In the examples below, replace the ED API KEY with your own key.

Linux Example

For instance, for Linux, the regular deployment command is:

To deploy with a profiler, the command would be:

Docker Example

In another example, for Docker, the regular deployment is:

  • docker run --rm -d --name edgedelta -v /var/run/docker.sock:/var/run/docker.sock:ro -e "ED_API_KEY=f1111e-e1d1-1ad1-b11d-d1a11111b1" gcr.io/edgedelta/agent:latest

To deploy with a profiler, the command would be:

  • docker run --rm -d --name edgedelta -v /var/run/docker.sock:/var/run/docker.sock:ro -e "ED_API_KEY=f1111e-e1d1-1ad1-b11d-d1a11111b1" -e "PROFILER_PORT=6060" gcr.io/edgedelta/agent:latest

Review the following installation documents. Remember to add PROFILER_PORT for port 6060 to the installation command:


Obtain a Profiler Report

When you obtain a profiler report, you can send the report to Edge Delta for analysis.

Note

You can also view the data using the pprof tool.

  1. Run the following command to install pprof, which requires golang installed: go install github.com/google/pprof@latest
  2. Run the following command to visualize pprof results: pprof -web /tmp/cpu.pb.gz

Based on the information you want to obtain, run the following command:

For information on heap, run:

  • curl -sK -v http://localhost:8080/debug/pprof/heap --output /tmp/heap.pb.gz

For information on CPU, run:

  • curl http://localhost:6060/debug/pprof/profile?seconds=60 --output /tmp/cpu.pb.gz

For information on goroutine, run:

  • curl http://localhost:6060/debug/pprof/goroutine --output /tmp/goroutine.pb.gx

Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.