Skip to content

Commit

Permalink
Support profiling for keda components (#1250)
Browse files Browse the repository at this point in the history
Signed-off-by: yuval weber <[email protected]>
Co-authored-by: Zbynek Roubalik <[email protected]>
  • Loading branch information
yuvalweber and zroubalik authored Oct 31, 2023
1 parent c55b607 commit 3294368
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions content/troubleshooting/profiling-keda-components.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
+++
title = "Troubleshoot KEDA errors using profiling"
+++

In Golang we have the possibility to profile specific actions in order to determine what causes an issue.
For example, if our `keda-operator` pod is keeps getting OOM after a specific time, using profilig we can profile the heap and see what operatios taking all of this space.

Golang support many profiling options like heap, cpu, goroutines and more... (for more info check this site https://pkg.go.dev/net/http/pprof).

In KEDA we provide the option to enable profiling on each component separately by enabling it using
the Helm chart and providing a port (if not enabled then it won't work).

```yaml
profiling:
operator:
enabled: false
port: 8082
metricsServer:
enabled: false
port: 8083
webhooks:
enabled: false
port: 8084
```
If not using the Helm chart then you can enable the profiling on each on of components by specifying the
following argument in the respective container
```bash
--profiling-bind-address=":8082"
```
and it will be exposed on the port you specified.

After enabling it you can port-forward or expose the service and use tool like go tool pprof in order to get profiling data.

For more info look at this document https://go.dev/blog/pprof.

0 comments on commit 3294368

Please sign in to comment.