Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add cpu/memory profiling draft #796

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Conversation

Andrew7234
Copy link
Collaborator

For debugging purposes

// Initialize cpu profiling.
if cfg.Metrics.CpuProfile != "" {
logger.Warn("CPU profiling is enabled, this will impact performance (negatively)", "dest", cfg.Metrics.CpuProfile)
cpuF, err := os.Create(cfg.Metrics.CpuProfile)
Copy link
Member

Choose a reason for hiding this comment

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

Can we instead add pprof.address (or similar) config parameter. Then if set, we start the pprof server on the provided address?

That is more generic and covers more profiling cases, since the user has more control over the profiling setup. That's the way we have it done in other projects, for example web3-gateway and oasis-core, and it tends to work pretty well in practice.

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