From 5a889951d37beaa25140d059d2b435855194ea70 Mon Sep 17 00:00:00 2001 From: amit-62 Date: Mon, 10 Apr 2023 19:54:32 +0530 Subject: [PATCH 1/3] Rust profiling RFC Signed-off-by: amit-62 --- design/0005-rust-profiling.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 design/0005-rust-profiling.md diff --git a/design/0005-rust-profiling.md b/design/0005-rust-profiling.md new file mode 100644 index 0000000..35796a3 --- /dev/null +++ b/design/0005-rust-profiling.md @@ -0,0 +1,32 @@ +# Title + +Contribution Name: (Profiling to Linkerd Rust controllers) + +## Problem + +Enabling users to dynamically profile the running application, which can aid +significantly in debugging and diagnostics. This will allow users to identify +and address performance bottlenecks or other issues in real-time and they can +act accordingly. + +## Desired Outcome + +With the new CLI arguments that enable pprof, users will be able to profile +resource consumption of individual controllers and gain insights into how the +policy-controller is operating. + +## Potential Solution + +Integrate [pprof-rs](https://github.com/tikv/pprof-rs/blob/master/README.md) +into the Linkerd Proxy-controller: pprof-rs is a profiling tool for Rust that +can be used to generate CPU profiles and heap snapshots. It can be integrated +into the Linkerd control plane to provide dynamic profiling capabilities to +users. This will involve adding the pprof-rs library as a dependency and +modifying the controllers to support pprof-rs. Create a new CLI argument that +tells the controller to enable-pprof profiling. Parse the new CLI argument and +start the ProfilerGuard if the argument is present. Implement a route that +exposes the profiling endpoint using the pprof crate. + +## Prior Art + +Pyroscope itself is a profiler tool which uses pprof-rs for profiling Rust code. From 036edb68e6e914db8c6abfe5987b557002624611 Mon Sep 17 00:00:00 2001 From: amit-62 Date: Mon, 10 Apr 2023 20:09:43 +0530 Subject: [PATCH 2/3] small improvement Signed-off-by: amit-62 --- design/0005-rust-profiling.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/design/0005-rust-profiling.md b/design/0005-rust-profiling.md index 35796a3..e1b5562 100644 --- a/design/0005-rust-profiling.md +++ b/design/0005-rust-profiling.md @@ -17,8 +17,8 @@ policy-controller is operating. ## Potential Solution -Integrate [pprof-rs](https://github.com/tikv/pprof-rs/blob/master/README.md) -into the Linkerd Proxy-controller: pprof-rs is a profiling tool for Rust that +__Integrate [pprof-rs](https://github.com/tikv/pprof-rs/blob/master/README.md) +into the Linkerd Proxy-controller__: pprof-rs is a profiling tool for Rust that can be used to generate CPU profiles and heap snapshots. It can be integrated into the Linkerd control plane to provide dynamic profiling capabilities to users. This will involve adding the pprof-rs library as a dependency and From 6b7e7e1fd3e34910d992f0543dd963593d5e979e Mon Sep 17 00:00:00 2001 From: amit-62 Date: Mon, 10 Apr 2023 20:13:18 +0530 Subject: [PATCH 3/3] Title changed Signed-off-by: amit-62 --- design/0005-rust-profiling.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/design/0005-rust-profiling.md b/design/0005-rust-profiling.md index e1b5562..935cac9 100644 --- a/design/0005-rust-profiling.md +++ b/design/0005-rust-profiling.md @@ -1,6 +1,6 @@ # Title -Contribution Name: (Profiling to Linkerd Rust controllers) +Add Profiling to the Linkerd Policy Controller ## Problem