Skip to content

feat: add pprof debug server for CPU and memory profiling#162

Merged
nssherpa merged 2 commits intomainfrom
nsherpa/pprof-profiling
Feb 26, 2026
Merged

feat: add pprof debug server for CPU and memory profiling#162
nssherpa merged 2 commits intomainfrom
nsherpa/pprof-profiling

Conversation

@nssherpa
Copy link
Contributor

Adds a pprof HTTP server (default :6060) exposing /debug/pprof/ endpoints for CPU and memory profiling. Configurable via pprof-bind in cachew.hcl; set to empty string to disable.

@nssherpa nssherpa force-pushed the nsherpa/pprof-profiling branch from bc6ad3e to 7958ed9 Compare February 26, 2026 07:01
State string `hcl:"state" default:"./state" help:"Base directory for all state (git mirrors, cache, etc.)."`
Bind string `hcl:"bind" default:"127.0.0.1:8080" help:"Bind address for the server."`
URL string `hcl:"url" default:"http://127.0.0.1:8080/" help:"Base URL for cachewd."`
PprofBind string `hcl:"pprof-bind" default:":6060" help:"Bind address for the pprof debug server (CPU/memory profiling). Empty string to disable."`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd just manually register the handlers with our existing server rather than starting a new one. Put it under /admin/pprof or something

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm also thinking if a separate port might help with to contend these requests with the main app?

@nssherpa nssherpa force-pushed the nsherpa/pprof-profiling branch from 3cc3334 to 048e9a5 Compare February 26, 2026 18:29
@nssherpa nssherpa marked this pull request as ready for review February 26, 2026 19:22
@nssherpa nssherpa requested a review from a team as a code owner February 26, 2026 19:22
@nssherpa nssherpa requested review from wsutina and removed request for a team February 26, 2026 19:22
@nssherpa nssherpa merged commit deaac6e into main Feb 26, 2026
6 checks passed
@nssherpa nssherpa deleted the nsherpa/pprof-profiling branch February 26, 2026 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants