From 266327642b62f75d5ab4674c8b41bd7c64a2fa62 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Tue, 5 May 2020 11:45:13 +0300 Subject: [PATCH] docs/{vmagent,vmauth}: add `Profiling` section --- app/vmagent/README.md | 21 +++++++++++++++++++++ app/vmauth/README.md | 21 +++++++++++++++++++++ docs/vmagent.md | 21 +++++++++++++++++++++ docs/vmauth.md | 21 +++++++++++++++++++++ 4 files changed, 84 insertions(+) diff --git a/app/vmagent/README.md b/app/vmagent/README.md index 81ec4fcf6..6544401b8 100644 --- a/app/vmagent/README.md +++ b/app/vmagent/README.md @@ -240,3 +240,24 @@ by setting it via `` environment variable. For example, the followin ```bash ROOT_IMAGE=alpine:3.11 make package-vmagent ``` + + +### Profiling + +`vmagent` provides handlers for collecting the following [Go profiles](https://blog.golang.org/profiling-go-programs): + +* Memory profile. It can be collected with the following command: + +```bash +curl -s http://:8428/debug/pprof/heap > mem.pprof +``` + +* CPU profile. It can be collected with the following command: + +```bash +curl -s http://:8428/debug/pprof/profile > cpu.pprof +``` + +The command for collecting CPU profile waits for 30 seconds before returning. + +The collected profiles may be analyzed with [go tool pprof](https://github.com/google/pprof). diff --git a/app/vmauth/README.md b/app/vmauth/README.md index fe81bb930..e3c5bc077 100644 --- a/app/vmauth/README.md +++ b/app/vmauth/README.md @@ -102,3 +102,24 @@ by setting it via `` environment variable. For example, the followin ```bash ROOT_IMAGE=alpine:3.11 make package-vmauth ``` + + +### Profiling + +`vmauth` provides handlers for collecting the following [Go profiles](https://blog.golang.org/profiling-go-programs): + +* Memory profile. It can be collected with the following command: + +```bash +curl -s http://:8428/debug/pprof/heap > mem.pprof +``` + +* CPU profile. It can be collected with the following command: + +```bash +curl -s http://:8428/debug/pprof/profile > cpu.pprof +``` + +The command for collecting CPU profile waits for 30 seconds before returning. + +The collected profiles may be analyzed with [go tool pprof](https://github.com/google/pprof). diff --git a/docs/vmagent.md b/docs/vmagent.md index 81ec4fcf6..6544401b8 100644 --- a/docs/vmagent.md +++ b/docs/vmagent.md @@ -240,3 +240,24 @@ by setting it via `` environment variable. For example, the followin ```bash ROOT_IMAGE=alpine:3.11 make package-vmagent ``` + + +### Profiling + +`vmagent` provides handlers for collecting the following [Go profiles](https://blog.golang.org/profiling-go-programs): + +* Memory profile. It can be collected with the following command: + +```bash +curl -s http://:8428/debug/pprof/heap > mem.pprof +``` + +* CPU profile. It can be collected with the following command: + +```bash +curl -s http://:8428/debug/pprof/profile > cpu.pprof +``` + +The command for collecting CPU profile waits for 30 seconds before returning. + +The collected profiles may be analyzed with [go tool pprof](https://github.com/google/pprof). diff --git a/docs/vmauth.md b/docs/vmauth.md index fe81bb930..e3c5bc077 100644 --- a/docs/vmauth.md +++ b/docs/vmauth.md @@ -102,3 +102,24 @@ by setting it via `` environment variable. For example, the followin ```bash ROOT_IMAGE=alpine:3.11 make package-vmauth ``` + + +### Profiling + +`vmauth` provides handlers for collecting the following [Go profiles](https://blog.golang.org/profiling-go-programs): + +* Memory profile. It can be collected with the following command: + +```bash +curl -s http://:8428/debug/pprof/heap > mem.pprof +``` + +* CPU profile. It can be collected with the following command: + +```bash +curl -s http://:8428/debug/pprof/profile > cpu.pprof +``` + +The command for collecting CPU profile waits for 30 seconds before returning. + +The collected profiles may be analyzed with [go tool pprof](https://github.com/google/pprof).