diff --git a/app/vmagent/README.md b/app/vmagent/README.md index 81ec4fcf65..6544401b85 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 fe81bb930a..e3c5bc0770 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 81ec4fcf65..6544401b85 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 fe81bb930a..e3c5bc0770 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).