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

Enable /debug/pprof/heap #384

Merged
merged 1 commit into from
Jul 31, 2024
Merged

Conversation

CalvinNeo
Copy link
Member

@CalvinNeo CalvinNeo commented Jul 31, 2024

What is changed and how it works?

Issue Number: Close #xxx

  1. While prof.activate is set to true, calling prof.dump will dump a heap file.
  2. The heap file can be transformed into svg format with the help from jeprof.
  3. TiFlash Proxy(TiKV) will embed a jeprof.in into its own code.
  4. When /debug/pprof/heap?jeprof=true is called, a perl sub-process is started with perl /dev/stdin --show_byte ${tiflash_path} ${heap_file_path} --svg.
  5. perl will execute the embedded script, and print the transformed svg files in stdout.

NOTE

  1. jeprof.in is not released to user.
  2. On some deployments, there could be insufficient privilege, so the API could fail and return to user with detailed message.
  3. perl must be provided, otherwise the API could fail and return to user with detailed message.

What's Changed:

Enable /debug/pprof/heap

Related changes

  • PR to update pingcap/docs/pingcap/docs-cn:
  • Need to cherry-pick to the release branch

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Release note

Support ad-hoc heap profiling

a
Signed-off-by: Calvin Neo <[email protected]>
@ti-chi-bot ti-chi-bot bot added the size/XXL label Jul 31, 2024
@CalvinNeo
Copy link
Member Author

img_v3_02da_f6173f4a-df20-43ee-848a-716ad768126g

@ti-chi-bot ti-chi-bot bot added the lgtm label Jul 31, 2024
Copy link

ti-chi-bot bot commented Jul 31, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JaySon-Huang

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link

ti-chi-bot bot commented Jul 31, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-07-31 07:05:43.484418188 +0000 UTC m=+339459.764466256: ☑️ agreed by JaySon-Huang.

@ti-chi-bot ti-chi-bot bot added the approved label Jul 31, 2024
@ti-chi-bot ti-chi-bot bot merged commit bb6ebf6 into pingcap:raftstore-proxy Jul 31, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants