Closed radiohead closed 1 year ago
Hey folks!
We're experimenting using kine with CockroachDB and I've run into OOMs with kine using up to 2GB of RAM in some situations. This seems to be related to https://github.com/k3s-io/kine/issues/87, since kine officially does not support CockroachDB.
That said, I'm looking into ways to improve peak memory usage, but I've noticed that there's no way to do remote profiling, so I've made this small change to enable it.
I've already tested this internally with https://hub.docker.com/repository/docker/radioheads/kine, but I'm happy to provide more info if necessary.
What
This PR adds a new flag, which, when enabled, allows for remote profiling using
net/http/pprof
package, with the handlers mounted to the metrics server.By default the flag is disabled, to ensure that the change is backwards-compatible.
Why
This allows for ad-hoc and continuous (e.g. using https://pyroscope.io/) profiling, which is useful for finding memory / cpu bottlenecks.