feat: add pprof debug server for CPU and memory profiling#162
Merged
Conversation
bc6ad3e to
7958ed9
Compare
alecthomas
reviewed
Feb 26, 2026
cmd/cachewd/main.go
Outdated
| 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."` |
Collaborator
There was a problem hiding this comment.
I'd just manually register the handlers with our existing server rather than starting a new one. Put it under /admin/pprof or something
Contributor
Author
There was a problem hiding this comment.
I'm also thinking if a separate port might help with to contend these requests with the main app?
alecthomas
approved these changes
Feb 26, 2026
3cc3334 to
048e9a5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a pprof HTTP server (default
:6060) exposing/debug/pprof/endpoints for CPU and memory profiling. Configurable viapprof-bindin cachew.hcl; set to empty string to disable.